By using AWS re:Post, you agree to the Terms of Use

The image cannot be displayed because it contains errors



I'm working with saving and displaying images in and S3 bucket. I am on a mac and the images show fine on the mac.

I am able to upload many images to the bucket and then I can display them using a pre-signed URL. All good...

But then I have some other varied images such as .jpg that I see fine on the mac and seem to upload OK however do not display from s3 using pre-signed URL. When viewed in Mac Safari or chrome or Firefox I get the broken image symbol. Firefox also says:

The image "https://xxxxxxxxxx" cannot be displayed because it contains errors"

Someone suggested that possibly the original file creation might have been strange in someway and the Mac might be able to interpret the image however S3 cannot do this successfully. Possibly this might be a cross platform Windows / Mac / Linux image issue?

Test: I took one of the .jpg images that did not show up from S3 - and I opened it in preview on the Mac and exported it also as .jpg under a different name. Then I uploaded this new Version add this did seem to fix the problem because it now she displays correctly from s3.

However for what I'm doing I do not want to have to export every image and resave it - in order to go to S3.

Q: Does anybody have any solutions as to why I am getting some Errors when trying to display images from S3? Any ideas how to fix this?

Quick update - in Mac terminal I tried : file -I ~/Desktop/test.jpg and surprisingly it came back as = image/heic even though the file had .jpg suffix.... Any idea how to get s3 to read "heic files"?

Thanks dave

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions