-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Wrong image rotation #21485
Comments
When you rotated the image, it added metadata that tells viewers the image should be rotated: http://regex.info/exif.cgi?dummy=on&imgurl=https%3A%2F%2Fcloud.githubusercontent.com%2Fassets%2F16576171%2F12143152%2F8e2892d8-b47e-11e5-9e74-7bfc2b1c5053.jpg (see EXIF Metadata: Orientation: Rotate 90 CW) We should detect such metadata in preview generation, but there's not much we can do about displaying it in the browser if the browser ignores the metadata... |
Just for your info, there is an owncloud clone used by some universities in germany. It is named sciebo. It´s nearly the same as original owncloud just with minor changes. So they used owncloud source for developing their own version. The picture above was shared within sciebo by one of my friends and i synchronized it directly with my owncloud. In sciebo the rotation is correct but in my owncloud it is wrong. |
Weird - I don't think they change such internals, but I will ask them. Back some time I fixed the rotation of the previews and it worked just fine with a lot of test images. See #13448 Maybe also try the original gallery app - that's also what is very likely used at sciebo: https://github.com/owncloud/gallery I can't reproduce the rotation issues on my local owncloud. Maybe you have an old version of the gd/imagick php module. |
Hi, I'm not sure if this is relevant but I have uploaded an image created on an iPhone 5S to one ownCloud account and it displays correctly in the image gallery however if I share that image to a second account on the same ownCloud server the image displays with incorrect rotation |
Thanks @ikeewee . Could one of you write down a 100% reproducible test case? Preferably one which doesn't involve Gallery, so no full screen preview before sharing per example. Something like:
but more detailed if it needs to be. |
These are the steps I can use to reproduce it here. This is on a recent fresh install of ownCloud 8.2.2 running on Linux Mint 17.2
This also happens if I share the photo directly from within the iOS app |
In my case it is very simple: But I think it is reproducible with any smartphone |
@massa007 Can I ask you to provide those images to us for debugging purposes? That would be helpful :) |
Reproduction steps
|
I fear in my case it is always wrong ^^ |
I suspect that people affected by the general issue don't have the EXIF extension installed... but @MorrisJobke's 2nd use case is probably a different issue 😢 |
@massa007 Check if the extension is really installed since it seems to fail from the start for you. |
I checked with the phpinfo site. Can you tell me how to really check it? |
Hmmm... The only proper way would be through a test script. I'm sure someone has written one which list the metadata and published it on the Internet. |
This is actually a duplicate of #20484, so closing this. |
I Inserted the php code in the corresponding php file with no change.. |
I don't think that this issue is a duplicate of #20484. All portrait images I ever uploaded via owncloud app from my Android phone are displayed in landscape mode. |
I've just tested both of these images on master and they both get the proper orientation. Don't forget that you have to clear the cache in order to get the new thumbnails generated. |
I turned on debug for my OC installation and then again deleted all thumbnails.
Because of the missing "file path" the orientation is set to -1. |
Hi everybody, In my case image rotation is corrupted when images are stored in external storages (CIFS/SMB for example). When the same images are uploaded to a "local" folder, everything seems to be fine (for more details have a look at the linked issue) |
I believe this issue started happening in version 8.2.0 though I might have been somewhere else between 8.0-8.2. I've been updated my owncloud, with encryption enabled, since 7.0.0 and started noticing it at one point but never posted a bug report. With encryption enabled I am seeing the ignoring of EXIF rotation of JPG thumbnails in the files app and the slideshow from the gallery app when you click on a JPG. |
I believe I was able to fix this issue in my testing. Both thumbnails and gallery previews are now respecting exif data for my encrypted files. =] In https://github.com/owncloud/core/blob/master/lib/private/preview/image.php I moved Now that thumbnail generate properly is there a proper way to delete my old thumbnails so owncloud generate all new ones? Should I just be clearing the thumbnail folders for all users? |
@oparoz @cmonteroluque if the fix mentioned here #21485 (comment) works could we backport into 9.0.X? It's a minor bug fix so I don't see an issue? |
So you changed it like this?
|
@Rayn0r exactly |
It looks like the behaviour was introduced by this commit a281737. Cleaning up the thumbnail directory solves it for me. @josh4trunks Thanx for the fix. You are my hero! |
Good job @josh4trunks :). That would explain why every backend except local storage can't rotate images. It's a bit surprising since we load the temp file into a PHP resource before deleting it, so it shouldn't have any impact.
|
Thanks |
@josh4trunks - There is one project to do exactly that: owncloud/gallery#22 , but it stalled due to the lack of funding, so yes, you can just delete that thumbnails folder and generate them again while browsing. |
Sounds good. Personally I'll wait to delete my thumbnail folders once this gets merged. |
Thanks a lot to josh4trunks for this:
After changing this and a quick test everything seems to work as expected for me now... |
@oparoz |
@josh4trunks - Probably too late as people still have to test the solution, but just create the PR online, move the unlink to the end. Then ping all the people who have confirmed it fixes things for them. |
I don't other providers would be affected because nothing else uses exif. k when I have a chance I'll write up a PR |
@oparoz do you know what branch I should work off so this gets backported to 9.0.X? |
@josh4trunks Always use master and ask for the backport in the PR. |
@oparoz Great, thanks! |
Coyping @karlitschek for backport |
nice fix. please backport 👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi all,
I want to refer to this issue: owncloud/gallery#29
I have the same problem and it seems there is no open issue yet.
Pictures are wrong rotated in gallery, as well as thumbnails and file explorer in owncloud.
If I download the pictures it´s all fine and my windows app shows correctly.
Operating system: Ubuntu Server 14.04
Web server: nginx current version
Database: MySQL
PHP version: Current version, exif enabled
ownCloud version: (see ownCloud admin page): 8.2.1
Updated from an older ownCloud or fresh install: fresh installation
The text was updated successfully, but these errors were encountered: