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

[stable10] Backport of Use loadFromFile instead of loadFromFileHandle #34356

merged 1 commit into from Feb 7, 2019


Copy link

@sharidas sharidas commented Feb 1, 2019

Use loadFromFile instead of loadFromFileHandle
while generating the thumbnail.

Signed-off-by: Sujith H


When loadFromFileHandle is used for generating thumbnail of images, the problem found is that it doesn't fix the orientation of images with exif. While loadFromFile handles this. It uses exif_imagetype before checking the mimetype of the image file. There is a word of caution noted in the ( reference: ). With the changeset the orientation issue while generating preview is resolved.

Related Issue

Motivation and Context

This changeset fixes the orientation issue of images while generating preview.

How Has This Been Tested?

  • Done basic test with a jpeg image with exif orientation. And the thumbnail was working. properly
  • The image used for testing was taken from the issue mentioned in the PR.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)


  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

Use loadFromFile instead of loadFromFileHandle
while generating the thumbnail.

Signed-off-by: Sujith H <>
@sharidas sharidas added this to the development milestone Feb 1, 2019
@sharidas sharidas self-assigned this Feb 1, 2019
Copy link
Contributor Author

sharidas commented Feb 1, 2019

Original PR #34297

Copy link

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Copy link

PVince81 commented Feb 1, 2019

to release for 10.1.1

Copy link

codecov bot commented Feb 1, 2019

Codecov Report

Merging #34356 into stable10 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##             stable10   #34356      +/-   ##
+ Coverage       63.48%   63.48%   +<.01%     
  Complexity      19121    19121              
  Files            1264     1264              
  Lines           75190    75189       -1     
  Branches         1288     1288              
+ Hits            47735    47737       +2     
+ Misses          27077    27074       -3     
  Partials          378      378
Flag Coverage Δ Complexity Δ
#javascript 53.31% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.57% <100%> (ø) 19121 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
lib/private/Preview/Image.php 87.5% <100%> (ø) 5 <0> (ø) ⬇️
apps/encryption/templates/settings-admin.php 88.23% <0%> (-5.89%) 0% <0%> (ø)
apps/encryption/lib/Session.php 98.03% <0%> (-1.97%) 22% <0%> (ø)
apps/files_trashbin/lib/Expiration.php 96.55% <0%> (-1.73%) 29% <0%> (ø)
...eratedfilesharing/lib/Controller/OcmController.php 66.06% <0%> (-0.21%) 30% <0%> (ø)
lib/private/legacy/image.php 48.06% <0%> (+1.15%) 170% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 857af69...157c558. Read the comment docs.

@phil-davis phil-davis merged commit 0722d54 into stable10 Feb 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-preview-image-orientation-stable10 branch February 7, 2019 13:06
@PVince81 PVince81 modified the milestones: development, QA Apr 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants