Replace Asset in Asset Editor
Has there ever been talk of adding a replace asset feature (similar to wp)? I ran into an issue today where I replaced assets in the filesystem but the old width/height and size of those files was stored in the meta. This caused new images to crop at the wrong aspect ratio. If the meta is generated on CP upload, maybe there could be a refresh:asset-meta command or replace asset feature in the Asset editor?
I'm almost certain this has been requested, but I can't find an issue. If anyone runs into, please mention it here. 🙂
Another idea to help with this would be a warning in the asset editor that the asset has been replaced, and ask if you want to refresh the image data (size and dimensions).
If it knew it was replaced it may as well just update it automatically.
https://github.com/statamic/ideas/issues/401
If anyone needs a workaround for this you can add it with a custom Action. Here's my current implementation, it has a couple of issues but it works:
https://gist.github.com/jacksleight/ee9506d6f16af7346f0848741de317cb
If anyone needs a workaround for this you can add it with a custom Action. Here's my current implementation, it has a couple of issues but it works:
gist.github.com/jacksleight/ee9506d6f16af7346f0848741de317cb
@jacksleight this should an addon!
I have a branch in progress where I was messing with this. It may become a thing in core, we'll see!
@edalzell
I considered that, but thought there were probably too many issues with it (even though it does mostly work). I imagine an implementation in core could work a lot better.
Still, if there’s demand I guess I could put an addon together, even if only as a temporary solution.