Bug 103351 - Insert Image: Image is flipped horizontal, if it's saved as greyscaled image
Summary: Insert Image: Image is flipped horizontal, if it's saved as greyscaled image
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2016-10-20 13:53 UTC by Robert Großkopf
Modified: 2016-11-10 04:09 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
First image is automatically flipped - difference to second: It's a greyscaled image. (87.32 KB, application/pdf)
2016-10-20 13:53 UTC, Robert Großkopf
Details
Package with a writer document and two images (one greyscaled, the other RGB) (58.91 KB, application/zip)
2016-10-20 13:54 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2016-10-20 13:53:10 UTC
Created attachment 128097 [details]
First image is automatically flipped - difference to second: It's a greyscaled image.

Open the attached *.pdf-file. 
First in Writer imported image is flipped horizontal automatically while importing the image.
Difference between the first and the second image:
First image is exported as greyscale-image by GIMP.
Second image is exported as RGB-image by GIMP.

If you export this to *.pdf, the first image will be reflipped to the right position in the *.pdf. So I had to print into a file to show the behavior of Writer.

This buggy behavior I detected with
Version: 5.3.0.0.alpha0+
Build ID: f3d9249ca6be6e69362b3ae90842fd2211fd0829
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-10-17_06:11:04
Locale: de-DE (de_DE.UTF-8); Calc: group

The bug doesn't appear in LO 5.2.2.2 on OpenSUSE 42.1 64bit rpm Linux.
Comment 1 Robert Großkopf 2016-10-20 13:54:46 UTC
Created attachment 128098 [details]
Package with a writer document and two images (one greyscaled, the other RGB)
Comment 2 Aron Budea 2016-10-21 08:46:28 UTC
Confirmed with 5.3 daily build / Windows 7.
Looks correct in 5.2.2.2.

Version: 5.3.0.0.alpha0+
Build ID: c2b48a763df113e63e6a27ee05b9a6834e4e49a4
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-10-20_06:56:44
Locale: hu-HU (hu_HU); Calc: CL
Comment 3 raal 2016-10-23 22:10:49 UTC
This seems to have begun at the below commit.
Adding Cc: to Tomaž Vajngerl; Could you possibly take a look at this one? Thanks

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.

 d022f589c08c2fd245eb682945a306a9765a64c7 is the first bad commit
commit d022f589c08c2fd245eb682945a306a9765a64c7
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Tue Oct 4 05:50:03 2016 -0700

    source 8a04fac29da8ae902bd5f0aac559129013274304
Comment 4 Xisco Faulí 2016-11-09 09:15:45 UTC
*** Bug 103801 has been marked as a duplicate of this bug. ***
Comment 5 V Stuart Foote 2016-11-10 04:05:05 UTC
Its fixed... thanks Tomaž!

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

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
Comment 6 V Stuart Foote 2016-11-10 04:08:56 UTC
Think the gray scale depth was fixed with this, but the RGB with the other. Any how they all seem correct now...

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