Including picture results in crash

Bug #1275443 reported by Kris on 2014-02-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
jazzynico

Bug Description

This specific image in attachment (originating from facebook, so hopefully not a copyright problem to post it here) crashes Inkscape when including it (either via dropping on Inkscape or via File > Import). It hangs Inkscape with 1 core occupied when opening it via File > Open.

On win vista 64 bit:
Occurs with trunk r12993.
Does not occur with Inkscape 0.48.x r10009.

Kris (kris-degussem) wrote :
tags: added: bitmap regression
Alvin Penner (apenner) wrote :

confirmed on Windows XP, Inkscape rev 12991, console messages attached.

(inkscape.exe:3844): GLib-GObject-WARNING **: value "-1.#INF00" of type `gdouble' is invalid or out of range for property `lower' of type `gdouble'

(inkscape.exe:3844): GLib-GObject-WARNING **: value "1.#INF00" of type `gdouble' is invalid or out of range for property `upper' of type `gdouble'

(inkscape.exe:3844): GLib-GObject-WARNING **: value "-1.#IND00" of type `gdouble' is invalid or out of range for property `page-size' of type `gdouble'

(inkscape.exe:3844): GLib-GObject-WARNING **: value "-1.#IND00" of type `gdouble' is invalid or out of range for property `step-increment' of type `gdouble'

(inkscape.exe:3844): GLib-GObject-WARNING **: value "-1.#IND00" of type `gdouble' is invalid or out of range for property `page-increment' of type `gdouble'

Changed in inkscape:
status: New → Confirmed
Alvin Penner (apenner) wrote :

if I specify a check mark on the Preferences option Bitmap -> Override file resolution, and use a resolution of 90 dpi then the file opens normally

Alvin Penner (apenner) wrote :

the problem may be related to the fact that this jpg does not seem to have a default resolution specified inside the file. Most jpg files would have a header section called JFIF which specifies the resolution. This file does not, instead it has a section called ICC_PROFILE.

su_v (suv-lp) wrote :

Reproduced with r12991 on OS X 10.7.5.

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.91
status: Confirmed → Triaged
tags: added: crash
su_v (suv-lp) wrote :

Testing with archived builds on OS X 10.7.5:
- not reproduced with rev <= 11563,
- reproduced with rev >= 12570,
the regression seems to be related to the original patch to support image resolutions on import:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/changes/11570>
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/11567>

Alvin Penner (apenner) wrote :

my comment 4 above is probably misleading and should probably be ignored. It is true that the crash occurs or doesn't occur depending on the setting of the Preference for override file resolution. But that does not necessarily mean that it is specifically related to image resolution. If it were related to image resolution it should occur for other file types as well. I have tried to make a crash by loading png files that have no header info and no resolution info in them, and they do not crash.
   Maybe the crash is related to the fact that if you choose to override the file resolution, that means that the jpg header is not read at all, thus avoiding the crash.
    When you load the original jpg into Gimp you get the attached message concerning ICC, which is quite unique and would not normally occur.

su_v (suv-lp) wrote :

On 2014-02-02 19:04 +0100, Alvin Penner wrote:
> When you load the original jpg into Gimp you get the attached message
> concerning ICC, which is quite unique and would not normally occur.

AFAIU this is normal for images with embedded color profiles:
<http://docs.gimp.org/2.8/en/gimp-imaging-color-management.html#plug-in-icc-profile-set>

jazzynico (jazzynico) wrote :

I'm going to take a look.

Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
jazzynico (jazzynico) wrote :

> Most jpg files would have a header section called JFIF which specifies the resolution. This file does not,

It does (at least cinfo.saw_JFIF_marker is true), but the X and Y density values are set to 0 (unknown).

It's quite easy to fall-back to the default Inkscape resolution, but it would be nicer if we could retrieve it from the ICC profiles.
Investigation in progress.

Alvin Penner (apenner) wrote :

yes, you're right, I did not look far enough into the file. When I looked further in my hex viewer I found the JFIF at byte location 516, farther on than usual, and it gave the value of 0 for resolution.

I tried the online viewer at
http://exifdata.com/
and it gave N/A for resolution.

jazzynico (jazzynico) wrote :

According to http://www.jpeg.org/public/jfif.pdf (page 7):
"Xdensity and Ydensity should always be non-zero".

I guess it should be respected, ICC profile or not.

jazzynico (jazzynico) on 2014-02-05
Changed in inkscape:
status: Triaged → In Progress
jazzynico (jazzynico) wrote :

Fixed in the trunk, revision 13006.
If we have a zero value for X density or Y density, we consider the value invalid, and thus fall back to Image Magick (or use the default Inkscape preferences if IM fails).

Changed in inkscape:
milestone: 0.91 → none
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers