Bug 74051 - EDITING "Graphics filter not found" inserting picture into Writer
Summary: EDITING "Graphics filter not found" inserting picture into Writer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: All All
: high major
Assignee: Caolán McNamara
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard: target:4.3.0 target:4.1.6 target:4.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-25 15:49 UTC by Chris Peñalver
Modified: 2014-01-29 21:43 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
example.jpeg (1.52 MB, image/jpeg)
2014-01-25 15:49 UTC, Chris Peñalver
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Peñalver 2014-01-25 15:49:37 UTC
Created attachment 92771 [details]
example.jpeg

1) lsb_release -rd
Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04

2) apt-cache policy libreoffice-writer
libreoffice-writer:
  Installed: 1:4.1.3-0ubuntu3
  Candidate: 1:4.1.3-0ubuntu3
  Version table:
 *** 1:4.1.3-0ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen in a blank Writer document is click Insert -> Picture... -> From File... and choose the attached example.jpeg and it inserts successfully, like it did in prior versions of LibreOffice (ex. 4.1.2).

4) What happens instead is a window pops up noting:
LibreOffice 4.1.3.2
Graphics filter not found

Also reproducible in MASTER:
LibreOfficeDev 4.3.0.0.alpha0
Image filter not found

Microsoft Windows Vista Business x86 6.0.6002 Service Pack 2 Build 6002
Version: 4.3.0.0.alpha0+
Build ID: f013eab80638e732d9cc81af798b2e554c1666fa
TinderBox: Win-x86@39, Branch:master, Time: 2014-01-24_00:29:3

This problem is not limited to this particular file, or file format. Tried larger file sizes, and png file format, same thing.
Comment 1 Julien Nabet 2014-01-25 17:37:20 UTC
Christopher: are you sure there's no pb with the image, it's 1.5MB and displays only black (with some white borders) on pc Debian testing and Gnome 3.10.1 displayer?
Comment 2 Chris Peñalver 2014-01-25 18:21:33 UTC
Julien Nabet, thank you for your comment. The attached picture is intentionally all black. As well, as noted in the Description, this is not localized to this file, or format.
Comment 3 Chris Peñalver 2014-01-26 04:06:57 UTC
As a follow up the same attached picture successfully inserts in AbiWord:
apt-cache policy abiword
abiword:
  Installed: 3.0.0-2ubuntu1
  Candidate: 3.0.0-2ubuntu1
  Version table:
 *** 3.0.0-2ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

and Microsoft Word for Mac 2011
Version 14.3.9(131030)
OS X 10.9.1

So, this problem would lie with LibreOffice, not whether or not the image is properly created, image size, etc.
Comment 4 Julien Nabet 2014-01-26 09:02:17 UTC
Thank you Christopher for your feedback.

Caolán/Michael: I noticed that in the file vcl/source/filter/jpeg/JpegReader.cxx, if the 2 following checks are removed, the image displays:
    236     sal_uInt64 nSize = aSize.Width();
    237     nSize *= aSize.Height();
    238 /*
    239     if (nSize > SAL_MAX_INT32 / 24)
    240         return NULL;
    241 */

    243     // Check if the bitmap is untypically large.
    244 /*
    245     if (nSize*(bGray?1:3) > MAX_BITMAP_BYTE_SIZE)
    246     {
    247         // Do not try to acquire resources for the large bitmap or to
    248         // read the bitmap into memory.
    249         return NULL;
    250     }
    251 */

(see http://opengrok.libreoffice.org/xref/core/vcl/source/filter/jpeg/JpegReader.cxx#235)
The problem is, even once the image is loaded, each time I scroll, Writer almost freezes and cpu is at 100%

Any idea?
Comment 5 Caolán McNamara 2014-01-27 15:06:27 UTC
8430x11700 pixels is the problem, it's considered excessive by the import. If you scale it down to e.g. half that resolution it would import fine. I'll raise the limit of 256M per image to 512M.
Comment 6 Commit Notification 2014-01-27 15:24:30 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: fdo#74051 support 8430x11700 jpegs



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 Commit Notification 2014-01-28 16:56:00 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=622d57e9e33a63849f0a472c0cb3e94513f784c0&h=libreoffice-4-1

Resolves: fdo#74051 support 8430x11700 jpegs


It will be available in LibreOffice 4.1.6.

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 8 Commit Notification 2014-01-28 16:56:31 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5ced55668d729c49c154f9d2d81907f3d44e3593&h=libreoffice-4-2

Resolves: fdo#74051 support 8430x11700 jpegs


It will be available in LibreOffice 4.2.1.

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 9 Chris Peñalver 2014-01-29 21:43:07 UTC
Works as expected in:
Version: 4.3.0.0.alpha0+
Build ID: aeeaccf59abbc485d7786486f1accc1cb4d4dbf7
TinderBox: Win-x86@39, Branch:master, Time: 2014-01-29_03:40:18
Microsoft Windows Vista Business x86 6.0.6002 Service Pack 2 Build 6002