news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

Image upload should not blindly assign PNG extension #386

Closed jacqui closed 2 years ago

jacqui commented 2 years ago

Investigating the mysterious wordpress conversion of some images from PNG to JPG revealed that the uploadImageToS3() function is blindly assigning all photos in the content the .png file extension.

~It should instead inspect the given contentUri and use the actual file extension.~ As the content URI from Google Docs does NOT include an extension, and the image metadata available to the sidebar also completely lacks any info on what kind of image the photo is, we should use the image ID as the filename and not assign any extension.