How do I rename product media filenames with the products API deprecation update ?

How do I rename product media filenames with the products API deprecation update ?

Eligijus
Shopify Partner
10 0 2

With the deprecation of productImageUpdate I cannot upload a renamed image with productUpdateMedia.

 

As an image optimizaiton app that optimizes over 100 thousand images each day (we optimize filenames, convert from png to jpg and add ALT texts) and with this new updates, I cannot see a way to upload new filenames through productUpdateMedia.

 

Previously It was really easy through productImageUpdate or to update all images at once with REST API products/product_id.json 

 

Is there a way now to upload new product gallery images with new filenames and ALT texts ? 

Replies 2 (2)

Stephan_Leroux
Shopify Staff
5 0 1

Hello!

 

Unfortunately we don't have an alternative option do this outside the deprecated API in REST. We do however have a targeted API for doing exactly this in GraphQL: fileUpdate.

 

With fileUpdate, you'll be able to directly rename the file or update alt texts. If the file is being referenced by a product, it should be updated for the product as well. 

To learn more visit the Shopify Help Center or the Community Blog.

Eligijus
Shopify Partner
10 0 2
If I want to upload a png image instead of jpg image (to have the image transparent) - I cannot do that as as black background is applied: https://prnt.sc/4a_qacYbqLlR
 
Same goes the other way around. If I want to upload a converted image from png to jpg (as It's a log lighter in most cases) - I cannot do that. I get the error "The filename extension provided must match the original filename.".
 
Please advise as we need a way to change the image filename and It's extension too. 
 
We optimize millions of images each month for merchants and file conversion from png to jpg is really widely used. To be exact - 93% of our customers use png to jpg conversion. 
 
This functionality is crucial for us and all other image optimization apps, background removal apps and image modification apps.