After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 569661 - Import from PDF throws errors when entering resolution in pixels per millimetre
Import from PDF throws errors when entering resolution in pixels per millimetre
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.4
Other All
: Normal normal
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-29 12:11 UTC by memelink.akker
Modified: 2009-07-08 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch for what seems to be a simple typo (627 bytes, patch)
2009-07-02 11:09 UTC, Massimo
committed Details | Review

Description memelink.akker 2009-01-29 12:11:38 UTC
Please describe the problem:
When importing a PDF document in Gimp, a dialog titles "Import from PDF" appears. The dialog provides a field "Resolution", with a choice control for the units.
Changing to units "pixels per millimetre" correctly adjusts the numerical value in the preceding resolution field. The document is imported correctly. 
When changing the unit AND the numerical value in the resolution field (example: to 10 pixels per millimetre) Gimp throws error messages when the "Import" button is pressed.

Observed in Gimp 2.6.3 and 2.6.4 on openSuSE 11.0 (x86_64)

Steps to reproduce:
1. Drop PDF document on tools window -> "Import from PDF" dialogue appears
2. Change units of resolution to "pixels per millimetre"
3. Change value of resolution to any reasonable value (eg: 10)
4. Press "Import" button



Actual results:
Error messages appear:

Calling error for procedure 'gimp-image-new':
Procedure 'gimp-image-new' has been called with value '0' for argument 'width' (#1, type GimpInt32). This value is out of range.

Calling error for procedure 'gimp-image-undo-disable':
Procedure 'gimp-image-undo-disable' has been called with an invalid ID for argument 'image'. Most likely a plug-in is trying to work on an image that doesn't exist any longer.

Calling error for procedure 'gimp-image-set-filename':
Procedure 'gimp-image-set-filename' has been called with an invalid ID for argument 'image'. Most likely a plug-in is trying to work on an image that doesn't exist any longer.

Too many error messages!
Messages are redirected to stderr.

Expected results:
Selected pages of PDF document are imported with given resolution

Does this happen every time?
Yes, tried with several PDF-documents and 2 versions of gimp

Other information:
Comment 1 memelink.akker 2009-01-29 13:19:56 UTC
Same problem observed with gimp 2.4.5 on Windows XP
Comment 2 Massimo 2009-07-02 11:09:26 UTC
Created attachment 137726 [details] [review]
A patch for what seems to be a simple typo

This one is a typo in file 'plug-ins/common/file-pdf.c'

attached is a patch against the sources of the release 2.6.6.

Massimo
Comment 3 memelink.akker 2009-07-02 11:41:09 UTC
Thanks Massimo.

I notice that the bug is still labelled "Unconfirmed". Does that mean that this bug still needs to be assigned to someone to review this patch? 

Or will it be included in 2.6.7 or 2.8.0 automatically now?

Stephan
Comment 4 Martin Nordholts 2009-07-02 15:39:32 UTC
Massimo, what is your full name and what email address would you like to use for the commit? It shall be in the format "Martin Nordholts <martinn@src.gnome.org>"
Comment 5 Sven Neumann 2009-07-02 19:42:02 UTC
Unconfirmed means that it has not yet been reproduced and confirmed by a GIMP developer. Since we have a patch now, I will assume that Massimo has been able to reproduce it. Setting the state and milestone accordingly.
Comment 6 Sven Neumann 2009-07-08 19:26:42 UTC
Patch applied to master and merged to the gimp-2-6 branch. Closing as FIXED.
Massimo, thanks a lot for your help with this bug.

commit a7bca9407d7dec994cbb116e32e84589d34840a5
Author: Massimo Valentini <sixtysix@inwind.it>
Date:   Tue Jul 7 17:09:21 2009 +0200

    Bug 569661 – Import from PDF throws errors when entering resolution in pixel
    
    Fix calculation of dpi value.

 plug-ins/common/file-pdf.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)