Search…

X3 Photo Gallery Support Forums

Search…
 
jorgep
Posts: 5
Joined: 08 May 2020, 21:33

Re: Files App 0.1.0 :green_apple:

08 May 2020, 22:31

I just found this app and I am loving it!    
Very easy to install / configure and your documentation is very clear!
THANK YOU! 

I am having a small challenge with some of the cached thumbnails keeping the right orientation... 
My original image  is 3024 x 4032 and 2.59 MG

The thumbnail gets created 480 x360 and 55.7KB
The images show in the main view (grid, row and columns)   in the incorrect orientation from the original, and then when I click on the image
it (using  pop-up mode) get displayed in the right orientation but unfortunately it is distorted... 

I have tried several of the settings, but I am missing a resolution....

Any ideas?   Again - MANY thanks!

Sample issue graphic at:   http://pages.jp250.com/SampleIssue001.png
 
User avatar
mjau-mjau
X3 Wizard
Topic Author
Posts: 12093
Joined: 30 Sep 2006, 03:37

Re: Files App 0.1.0 :green_apple:

09 May 2020, 03:31

Aha! Thanks for the feedback. From experience, I know what causes this issue, and it's something I need to deal with in a future update of Files app. Here's what's happening.

Cause: Image EXIF rotation
Your image is taken from a device (I am guessing Android phone), which does not actually rotate the image according to orientation when it is taken. Instead, the "rotation" value is stored in your image's EXIF meta data. That is why most (non-web) applications will display the image in correct orientation, because they will use the EXIF rotation value when displaying the image. You can check this by uploading your photo here metapicz.com, which will show that your image contains EXIF orientation settings. You will also find that the image is either correctly- or incorrectly rotated, depending on if your browser supports inline exif rotation. It will differ across different browsers. You can read more about problems with EXIF rotation in the following links:
howtogeek.com/254830/why-your-photos-dont-always-appear-correctly-rotated
medium.com/@Orangeeli/oh-my-exif-777335e26213


Anyway, this is causing two somewhat separate issues:

1. Resized image
When resizing the image in Files app (via PHP), it does not know the EXIF rotation. The image is physically stored in landscape aspect, which is how it was stored from the camera device. Therefore, when Files app resizes the image, it will simply resize based on the physical dimensions of the image, which is in landscape format.

This can be fixed, as we can auto-rotate the resized image according to the EXIF rotation value stored inside the image.

2. Original image in popup
This is a separate issue, and where it gets a bit dodgy. In your screenshot, I can see that your image is in correct orientation, but that it's squashed. This is because the Files app is displaying the image based on width/height parameters from the file data (which is in landscape mode). However, your browser is smart enough to rotate the image according to the EXIF rotation value stored in image. The result (what you see), is that the orientation is correct (by browser), but the image gets sized in the popup as if it was in landscape format.

This becomes even more complicated now that SOME browsers support EXIF-rotation for embedded images, while some don't. If you try to open that image in POPUP from a few different browsers, you will find that 1) Some browsers (like yours), will rotate the image correctly (although it will be squashed), while 2) Some browsers will not rotate the image, which means it will have incorrect orientation (landscape), but at least it will not be squashed.

This is more complicated to solve, because I need to detect if 1) The image has EXIF rotation, 2) The browser supports EXIF rotation and intends to rotate the image based on EXIF, and then 3) Modify the popup output. Complicated, but I will look into it!

---

The ultimate solution
The ultimate solution (so to speak), would be if your images were already correctly physically oriented, instead of having the orientation value stored in the image's EXIF meta data. Especially for images you intend to display on the web (in a web browser). 
  1. Set your phone camera to physically rotate images
    This might not even be an option in many phones, but most phones (at least iPhone) will already store the image with correct physical orientation (instead of storing orientation in EXIF). The reason some phones don't physically rotate the image when it's taken, is because it require additional CPU usage. Of course, even if this is an option on your smartphone, it won't affect photos you have already taken.
  2. Use a desktop application to correct orientation
    There are many desktop apps available, that will auto-rotate your images based on the stored EXIF value. This means that, although they "seem" correct already, these apps will actually convert the EXIF rotation to physical rotation. That means there will be no problems when viewing the images from the web. Here are a few apps I found:
---

Conclusion
In conclusion, it should be simple to fix the rotation for thumbnails generated by Files app. The issue in the popup is more complicated, although I will look into that also. Could you please send me the original image, so I can do some tests? Thanks  :thumbsup:
 
jorgep
Posts: 5
Joined: 08 May 2020, 21:33

Re: Files App 0.1.0 :green_apple:

09 May 2020, 11:26

Wow - Incredibly fast and  detailed response!   love the "why" explanation -- Thank you.
Actually it is from an iPhone but I guess it is kind of the same issue :-)  

Will try those things and report back....  --  Just PM you the sample files.  
Cheers!
J
 
User avatar
mjau-mjau
X3 Wizard
Topic Author
Posts: 12093
Joined: 30 Sep 2006, 03:37

Re: Files App 0.1.0 :green_apple:

09 May 2020, 23:35

jorgep wrote:Actually it is from an iPhone but I guess it is kind of the same issue :-)
It's definitely the same issue, although I thought iOS rotated the image physically when photo is taken. Maybe I'm wrong, or maybe it's related to iOS version or iPhone version.
 
jorgep
Posts: 5
Joined: 08 May 2020, 21:33

Re: Files App 0.1.0 :green_apple:

10 May 2020, 13:52

I just completed my test.... Definitely iPhone related (using the latest iOS 13.4.1) -

Of the tools you mentioned above, I end up using  JPEG Autorotate v3   which easily stripped the EXIF  orientation  data and everything worked perfectly with Files App -     It orientates correctly and it ALSO shows the photo in popup correctly scaled (not squashed)   

Again - MANY Thanks for your help and prompt response!
Cheers!
J