Bug 103801 - OpenGL JPEG images inverted
Summary: OpenGL JPEG images inverted
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2016-11-09 08:37 UTC by Luke
Modified: 2016-11-10 03:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample document showing inverted pictures (25.10 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-11-09 08:40 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2016-11-09 08:37:32 UTC
Description:
Certain images are rotated 180 degrees when view with the OpenGL Renderer. 

Steps to Reproduce:
1. Make sure Tools->Options->View->"Use OpenGL for all rendering" is checked
2. Open the bug doc with a recent build of Writer


Actual Results:  
Image is flipped along horizontal axis.

Expected Results:
Should display normal.


Reproducible: Always

User Profile Reset: No

Additional Info:
Using tinderbox builds, I was able to narrow the range of this regression to:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=a6ce5d391476e4b6a2cb2d92ff45548c1d75684b..32bdc5097013e7efd9c85e1b8df697880e66e925


User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36
Comment 1 Luke 2016-11-09 08:40:22 UTC
Created attachment 128607 [details]
sample document showing inverted pictures

Note I could reproduce this bug with both my Intel HD 5000 and Nvidia GTX 650.
Comment 2 Xisco Faulí 2016-11-09 08:51:45 UTC
Confirmed in

Version: 5.3.0.0.alpha1+
Build ID: 8a2a3f1032b4e60f7607e3ecb1ff99a6bb9af7f9
CPU Threads: 4; OS Version: Linux 4.2; UI Render: GL; VCL: gtk2; Layout Engine: new; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 3 Xisco Faulí 2016-11-09 09:15:45 UTC
Regression introduced by:

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.com>	2016-10-03 16:39:04 (GMT)
committer	Tomaž Vajngerl <quikee@gmail.com>	2016-10-04 12:15:24 (GMT)
commit 8a04fac29da8ae902bd5f0aac559129013274304 (patch)
tree 0615500e9bc8b1b736ee2ed7922167b31199cfbd
parent d954f856a9909a582b089fd9339b0930d57914d7 (diff)

vcl: read image from JPEG one scanline at a time
When reading an image from JPEG file we allocate a large buffer
to hold the whole raw image before we read it into SalBitmap.
If the image is large this step will spike the memory usage.

This changes reading so that we allocate only the buffer for
a scanline and read one scanline at a time.

which is the same commit as in bug 103351

*** This bug has been marked as a duplicate of bug 103351 ***
Comment 4 Luke 2016-11-09 09:46:11 UTC
Xisco Faulí if it's a duplicate, why am I only seeing the regression start at 11-04? Also no mention of OpenGL in bug 103351.
Comment 5 Xisco Faulí 2016-11-09 09:54:04 UTC
I don't know why but my last commit in my build is from Thu Nov 3 08:47:47 2016 and I can already reproduce the issue.
Comment 6 Commit Notification 2016-11-09 14:15:01 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0d1571916116e16ce6a64ab231f7f8632fcbd0e8

tdf#103801 JPEG - don't handle buffer orientation in import

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 V Stuart Foote 2016-11-09 15:24:41 UTC
also saw this rotation in OpenGL first manifest at the 32bdc5097013e7efd9c85e1b8df697880e66e925 (2016-11-04_23:30:30) build
which had the RGB color channel issue

But, looks like Tomaž has them both corrected.
Comment 8 Luke 2016-11-10 00:10:24 UTC
Xisco,

I bisected this bug to an 11/4 commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=6b571ae4608ac15256eb7582f442ce69975370f3

If you're seeing this on 11/3, it's a different issue. Please be sure to confirm that Tomaž's patch also fixes your issue. BTW, I tested this on Windows 10 with Nvidia gtx 650 and Intel HD 5000.
Comment 9 V Stuart Foote 2016-11-10 03:53:34 UTC
Its fixed... thanks Tomaž!

On Windows 10 Pro 64-bit (1607) en-US with
Version: 5.3.0.0.alpha1+
Build ID: f6391d9696bfa7485bf785ac81edef4d5441e232
CPU Threads: 8; OS Version: Windows 6.2; UI Render: GL; Layout Engine: new; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-11-10_00:11:47
Locale: en-US (en_US); Calc: CL