Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: File preview endpoint flips image #8209

Open
2 tasks done
Andree98 opened this issue May 28, 2024 · 7 comments
Open
2 tasks done

🐛 Bug Report: File preview endpoint flips image #8209

Andree98 opened this issue May 28, 2024 · 7 comments
Assignees
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.

Comments

@Andree98
Copy link

Andree98 commented May 28, 2024

👟 Reproduction steps

I have this image that is normal when using the file view endpoint and flipped when using the file preview endpoint

File view:
https://cloud.appwrite.io/v1/storage/buckets/6603d55cba54c384dd55/files/6603d565014591781c7a/view?project=65fae85dcbef6b0998bf

File preview:
https://cloud.appwrite.io/v1/storage/buckets/6603d55cba54c384dd55/files/6603d565014591781c7a/preview?project=65fae85dcbef6b0998bf

Some info:

  • I can only reproduce with this specific image, other images are ok
  • This only started happening to this image in version 1.5, this specific image is ok in previous versions

👍 Expected behavior

It should not flip the image in the preview endpoint unless specified

👎 Actual Behavior

The image is flipped

Related thread:

https://discord.com/channels/564160730845151244/1220007527626964992

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Andree98 Andree98 added the bug Something isn't working label May 28, 2024
@stnguyen90 stnguyen90 added the product / storage Fixes and upgrades for the Appwrite Storage. label May 28, 2024
@stnguyen90
Copy link
Contributor

stnguyen90 commented May 28, 2024

Uploading here just in case:

image_picker_B62D9407-C846-4815-956F-177FEF289B8F-25625-00000060BB59EDAA

@stnguyen90
Copy link
Contributor

Hmm this might be an iOS bug 🧐

https://discussions.apple.com/thread/255553292?sortBy=best

@Andree98
Copy link
Author

Andree98 commented Jun 1, 2024

What's confusing me is the fact that this is not reproducible in versions prior to 1.5. So something must have changed in regards to how Appwrite handles images?

@puntiz
Copy link

puntiz commented Jun 3, 2024

I can see in Appwrite code where it check the Orientation Exif and it only deals with rotation (left, right and down) and ignores other kinds of Exif orientations like mirrored up, Mirrored down etc (Code here --> https://github.com/utopia-php/image/pull/19/files) .. Below link provides all JPG Exif orientation scenarios. Odd thing even the scenarios Appwrite checks for don't work. So preview API endpoint is doesn't work if JPG has any orientation Exif.

Storage Preview API endpoint hopefully, if it fully addresses this issue, should also introduce additional image manipulation i.e., flip vertical/ flip horizontal which the, currently, un-tackled Exif orientation requires.

https://www.galloway.me.uk/2012/01/uiimageorientation-exif-orientation-sample-images/

@stnguyen90
Copy link
Contributor

What's confusing me is the fact that this is not reproducible in versions prior to 1.5. So something must have changed in regards to how Appwrite handles images?

ya, i can confirm the image isn't flipped in 1.4.4:
image

So something must have changed in regards to how Appwrite handles images?

Logically, not much has changed between 0.5.4 and 0.6.1. 😵‍💫

@stnguyen90
Copy link
Contributor

stnguyen90 commented Jun 4, 2024

I just tested Appwrite 1.4.14 and the image still looks okay:

image

Appwrite 1.4.14 uses utopia-php/image version 0.6.1 so the image library isn't the problem 😕

My theory now is something changed in the base image: appwrite/docker-base@0.4.3...0.9.0

@stnguyen90 stnguyen90 self-assigned this Jun 4, 2024
@stnguyen90
Copy link
Contributor

@byawitz, did some tests and it seems like the version of imagemagick in our base image had a bug and upgrading it should fix the problem. On our end, looksl ike we just need to generate a new image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.
Projects
Status: In Review
Development

No branches or pull requests

3 participants