Media file replace

Is there any functional logic as to why the media images cannot be replaced?

We just found ourselves in the position where we have to replace image files on articles that are in 20+ different locales, and we had to upload the replacement image and then assign it manually to that page 20+ times, e.g. once for every locale (replace image with new one, save, publish).

4 Likes

Hey Tim, For the moment the way to do it is the same as you mentioned: fist upload the new image to your media library and then manually replace the image in all the documents, in all of the locales in the repo where the original image is.

Unfortunately as you’ve discovered, there is no automated way to do this or to know in which documents an image is used.

I’m going to tag the @features-team so they can add this as a feature request for future improvements.

Another thing that you may find useful is the Import / Export feature, it allows you to create new documents or update existing ones directly from your content repository's UI.

This feature is available starting from the Medium plan.

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.

I have a similar use-case for this feature request. We have a logo image that we use throughout our project, and now we have to add a © symbol to it. Instead of being able to simply swap out that image asset in one step, we have to:

  1. Upload the new image.
  2. Search for each document that uses the old image.
  3. Replace the image
  4. Save, publish
  5. Repeat

Would be much easier if we could just replace the logo image from the source.

1 Like

Hi Team,

This is something we've been discussing for a while, although it may seem easy enough to implement there are a lot of factors to consider.

The main issue is how replacing one image file could break many documents as it means republishing all of those linked documents in the API.

  • For example, this could cause problems in documents where the previous image matched the image dimension restrictions in that document and the new image does not even though it matches in some documents.
  • Republishing groups of documents could also cause problems in older documents in terms of creating broken links and content.

We have begun a process of creating a team more dedicated to working on the document editing features in Prismic. The result of this is our new 'Bulk Actions' feature, which may pave the way for features like this in the future as we begin to understand the challenges and solutions to issues like this.

So we aren't working on this feature at the moment, but if you're interested in participating in future discussions about this subject with our UX team it would really help and I can put them in contact with you here.

Let me know your thoughts.

Thanks.

2 Likes

Hi Phil,

Taking those 2 factors into consideration, as a stop gap measure is it feasible to enable image replacement, but only on a 'like-for-like' basis?

e.g. how about if you allowed images to be replaced, with the restriction that they are:

  • identically the same size (and if not they will be cropped to the original size)
  • and will be named the identical image name/id

Would this potentially resolve your main concerns about breaking documents / links?

Even as a temporary measure, from experience this would solve > 95% of our image use cases.

And for the future discussions, I agree the media files absolutely need to be fully replaceable, plus the ability to bulk delete from the media page. Thats pretty much all they need to do : )

Cheers,
Tim

1 Like

Hey Tim,

Sorry about the delay I was getting info from the team on this. So for the 2 restrictions you suggested.

  • identically the same size (and if not they will be cropped to the original size)

This would involved implementing an image editing system beyond just a like for like image replacement.

  • and will be named the identical image name/id

The image processing system automatically attaches an ID to images and caches them, so this is more complicated than it seems.

Even with these restrictions, this process would involve triggering a new publication of the API. So we would probably need a system check that will first show everywhere these images are in use so the user is aware and could confirm this is what they wanted to do.

So this really would need to be worked into the 'Bulk Actions' work that's happening.

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.