Bug 116888 - Bilevel GIF in a writer-document exported to PDF at low dpi renders fonts in outline, with OpenGL rendering
Summary: Bilevel GIF in a writer-document exported to PDF at low dpi renders fonts in ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.1.2 release
Hardware: All Windows (All)
: medium minor
Assignee: Luboš Luňák
URL:
Whiteboard: target:6.3.0
Keywords:
: 109532 (view as bug list)
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2018-04-08 20:30 UTC by Elmar Hinrichs
Modified: 2019-03-29 09:23 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
file export to pdf example (110.75 KB, application/vnd.oasis.opendocument.text)
2018-04-08 20:37 UTC, Elmar Hinrichs
Details
This is the output i still get. Also with the dev version. (161.23 KB, application/pdf)
2018-04-11 20:13 UTC, Elmar Hinrichs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar Hinrichs 2018-04-08 20:30:06 UTC
Description:
I imported a monocrome gif image (from gimp) into a writer document and wanted to export that document to pdf. It seems to be all right, but the output looks not useable.

Steps to Reproduce:
1. create a monocrome gif image using gimp
2. import this image to a writer document
3. export this ducument to pdf
4. look the result 

Actual Results:  
the image looks like an output of an algorithm that detects borders

Expected Results:
clean image


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 OPR/52.0.2871.40
Comment 1 Elmar Hinrichs 2018-04-08 20:37:44 UTC
Created attachment 141212 [details]
file export to pdf example
Comment 2 raal 2018-04-09 11:48:21 UTC
works for me Version: 6.1.0.0.alpha0+
Build ID: 4f268695787ff6c7052269058f7ae6de34abfd5d
CPU threads: 4; OS: Windows 6.1; UI render: default; 

Seems to be fixed with dev version. Please could you test it with dev version?  You can download it here: http://dev-builds.libreoffice.org/daily/master/
Thank you
Comment 3 MM 2018-04-09 19:18:26 UTC
On windows 7 x64 with Version: 6.0.3.2 (x64)
Build ID: 8f48d515416608e3a835360314dac7e47fd0b821
CPU threads: 3; OS: Windows 6.1; UI render: default

I don't see any picture on loading.
To make it work [atleast for me], extract the image and import it in LO(6) again.
The image is there on reload and on 'export as pdf'.
Comment 4 Elmar Hinrichs 2018-04-09 21:01:43 UTC
(In reply to raal from comment #2)
> works for me Version: 6.1.0.0.alpha0+
> Build ID: 4f268695787ff6c7052269058f7ae6de34abfd5d
> CPU threads: 4; OS: Windows 6.1; UI render: default; 
> 
> Seems to be fixed with dev version. Please could you test it with dev
> version?  You can download it here:
> http://dev-builds.libreoffice.org/daily/master/
> Thank you

Sorry Windows blocks the installation:
"
Der Computer wurde durch Windows geschützt
Von Windows Defender SmartScreen wurde der Start einer unbekannten App verhindert. Die Ausführung dieser App stellt u. U. ein Risiko für den PC dar.

App: 
master_2018-04-08_13.29.47_LibreOfficeDev_6.1.0.0.alpha0_Win_x86_en-US_de_ar_ja_ru_vec_qtz.msi 
Herausgeber:  
Unbekannter Herausgeber 
"
Comment 5 MM 2018-04-10 22:36:05 UTC
(In reply to Elmar Hinrichs from comment #4)
> 
> Sorry Windows blocks the installation:
> "
> Der Computer wurde durch Windows geschützt
> Von Windows Defender SmartScreen wurde der Start einer unbekannten App
> verhindert. Die Ausführung dieser App stellt u. U. ein Risiko für den PC dar.
> 
> App: 
> master_2018-04-08_13.29.47_LibreOfficeDev_6.1.0.0.alpha0_Win_x86_en-
> US_de_ar_ja_ru_vec_qtz.msi 
> Herausgeber:  
> Unbekannter Herausgeber 
> "

Try this first:

http://www.computerbild.de/artikel/cb-Tipps-Software-Windows-Warnmeldung-Downloads-deaktivieren-12960035.html
Comment 6 Elmar Hinrichs 2018-04-11 20:10:48 UTC
(In reply to raal from comment #2)
> works for me Version: 6.1.0.0.alpha0+
> Build ID: 4f268695787ff6c7052269058f7ae6de34abfd5d
> CPU threads: 4; OS: Windows 6.1; UI render: default; 
> 
> Seems to be fixed with dev version. Please could you test it with dev
> version?  You can download it here:
> http://dev-builds.libreoffice.org/daily/master/
> Thank you

Version: 6.1.0.0.alpha0+
Build-ID: 818619b0f2f7813decb26d0b14362dec76a8ff37
CPU-Threads: 16; BS: Windows 10.0; UI-Render: GL; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2018-04-08_13:29:47
Gebietsschema: de-DE (de_DE); Calc: CL

With this dev version it is still the same - no difference.
I will upload the pdf.
Comment 7 Elmar Hinrichs 2018-04-11 20:13:11 UTC
Created attachment 141290 [details]
This is the output i still get. Also with the dev version.
Comment 8 Elmar Hinrichs 2018-04-11 20:29:52 UTC
It seems to make a differen how the export to pdf is defined.
The failure comes to view if you choose the following:

lossless compression + adjust resolution to 150dpi
Comment 9 Laurent BP 2018-04-14 12:47:04 UTC
I cannot reproduce with Version: 5.4.7.1
Build ID: ef425abf896c652d177000096228d1dbcfe9c7af
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: gtk2; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
Comment 10 Laurent BP 2018-04-14 13:16:55 UTC
I can neither reproduce with Version: 5.4.1.2
Build ID: ea7cb86e6eeb2bf3a5af73a8f7777ac570321527
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: gtk2; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group

I chose lossless compression + adjust resolution to 150dpi in a fresh profile.

@Elmar: could you give your complete version information (Help > About LibreOffice : copy/paste all the text) ?
Comment 11 Alex ARNAUD 2018-04-14 13:51:41 UTC
I've added V Stuart in CC, I cannot reproduce it on my Debian 8 system.
Comment 12 V Stuart Foote 2018-04-14 15:45:38 UTC
Workaround -- disable OpenGL rendering...

Confirming on Windows 10 Home 64-bit en-US
Version: 6.0.3.2 (x64)
Build ID: 8f48d515416608e3a835360314dac7e47fd0b821
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (en_US); Calc: CL

and recent master/6.1.0
Version: 6.1.0.0.alpha0+ (x64)
Build ID: 55e84652ae84bd2374462ee19afd359a8cc90b95
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-04-13_05:08:28
Locale: en-US (en_US); Calc: CL

STR
1. Enable OpenGL rendering
2. Open attachment 141212 [details] to writer
3. Export (or Export as) to PDF
4. defaults (or profile reset):

   JPEG quality 90%
   reduce image quality to 300dpi
   create PDF form FDF
   export boookmarks

5. export --> PDF renders font as filled

6. reduce image quality to 150dpi (or 75dpi)

7. export --> PDF renders font to outline

Same affect on font rendering with Lossless compression, settings above 300dpi font is fully formed--150dpi and below the font is rendered outline.

However, _disable_ OpenGL rendering, repeat STR. And with default rendering, glyphs are filled at all resolutions. So this seems an issue with OpenGL rendering of the masked GIF.

The image is masked in Writer (so displaying just the "letterhead"). From ImageMagick's identify:

Image: 10000000000009B000000DB4D1C9DDC86292E537.gif
  Format: GIF (CompuServe graphics interchange format)
  Mime type: image/gif
  Class: PseudoClass
  Geometry: 2480x3508+0+0
  Units: Undefined
  Type: Bilevel
  Base type: Palette
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8/1-bit
  Channel depth:
    Gray: 1-bit
Comment 13 V Stuart Foote 2018-04-14 16:19:06 UTC
Tomaž, Armin -- thought you might be interested in this mishandling of bilevel GIFs with OpenGL which seems related to bug 103833 for our OpenGL rendering of bilevel PNGs.
Comment 14 Luboš Luňák 2019-03-25 16:03:47 UTC
https://gerrit.libreoffice.org/#/c/69699/
Comment 15 Luboš Luňák 2019-03-27 13:12:57 UTC
*** Bug 109532 has been marked as a duplicate of this bug. ***
Comment 16 Xisco Faulí 2019-03-27 14:46:55 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/f8dbee4d860b95717fa906935a8162c7edcd5973%5E%21

8bit image is "native" only if it has grey palette (tdf#116888)

It will be available in 6.3.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2019-03-28 14:43:53 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/df82c812e6dbb08837816ef9868bf24b3767ca1a%5E%21

make ReadTexture() also handle 8-bit non-grayscale images (tdf#116888)

It will be available in 6.3.0.

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

Affected users are encouraged to test the fix and report feedback.