Bug 692754 - Error processing pdf - cannot find default lab icc profile
Summary: Error processing pdf - cannot find default lab icc profile
Status: RESOLVED DUPLICATE of bug 692532
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 9.04
Hardware: PC All
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 18:03 UTC by Dave Smith
Modified: 2011-12-22 08:36 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Sample File (45.85 KB, application/pdf)
2011-12-20 18:22 UTC, Dave Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Smith 2011-12-20 18:03:04 UTC
I am running this command on Fedora 15 x64. It works fine under ghostscript 8.x. It is simulating a call I am running using the ghostscript API.


 gs -dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=display -dDisplayHandle=0 -dDisplayFormat=2052 -dDisplayResolution=300  -f /tmp/sample.pdf 


Unrecoverable error: typecheck in .putdeviceprops
sfopen: gs_parse_file_name failed.
  ./base/gsicc_manage.c:866: gsicc_open_search(): Could not find lab.icc 
| ./psi/zusparam.c:871: set_lab_icc(): cannot find default lab icc profile

 gs --help
GPL Ghostscript 9.04 (2011-08-05)
Search path:
   /usr/share/ghostscript/9.04/Resource/Init :
   /usr/share/ghostscript/9.04/lib :
   /usr/share/ghostscript/9.04/Resource/Font :
   /usr/share/ghostscript/fonts : /usr/share/fonts/default/ghostscript :
   /usr/share/fonts/default/Type1 : /usr/share/fonts/default/amspsfnt/pfb :
   /usr/share/fonts/default/cmpsfont/pfb : /usr/share/fonts :
   /usr/share/ghostscript/conf.d : /etc/ghostscript :
   /etc/ghostscript/9.04 : /usr/share/poppler/cMap/Adobe-CNS1 :
   /usr/share/poppler/cMap/Adobe-GB1 :
   /usr/share/poppler/cMap/Adobe-Japan1 :
   /usr/share/poppler/cMap/Adobe-Japan2 :
   /usr/share/poppler/cMap/Adobe-Korea1

 ls /usr/share/ghostscript/9.04/iccprofiles
default_cmyk.icc  default_gray.icc  default_rgb.icc  gray_to_k.icc  lab.icc  ps_cmyk.icc  ps_gray.icc  ps_rgb.icc  sgray.icc  srgb.icc
Comment 1 Chris Liddell (chrisl) 2011-12-20 18:07:51 UTC
I *suspect* this may be fixed by this commit:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=568854


Can't be sure, though.
Comment 2 Dave Smith 2011-12-20 18:15:14 UTC
(In reply to comment #1)
> I *suspect* this may be fixed by this commit:
> 
> http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=568854
> 
> 
> Can't be sure, though.

Fixed up gs_lev2.ps , now I am just getting Unrecoverable error: typecheck in .putdeviceprops

The pdf is good and like I said it does work on 8.64,72 etc ...
Comment 3 Chris Liddell (chrisl) 2011-12-20 18:19:39 UTC
Well, in that case, you'll really have to provide us with a sample file to test.
Comment 4 Dave Smith 2011-12-20 18:22:40 UTC
Created attachment 8230 [details]
Sample File

Must of eaten it the first time
Comment 5 Chris Liddell (chrisl) 2011-12-20 18:34:55 UTC
Well, it *seems* to work fine with the current master in our git repository, and with the (patched) 9.04 release in the Ubuntu Oneiric 11.10 release, so it's probably a issue that's been fixed since 9.04 was released.
Comment 6 Dave Smith 2011-12-20 19:00:13 UTC
(In reply to comment #5)
> Well, it *seems* to work fine with the current master in our git repository,
> and with the (patched) 9.04 release in the Ubuntu Oneiric 11.10 release, so
> it's probably a issue that's been fixed since 9.04 was released.

OK. I downloaded the Fedora 16 rpm and it is not fixed in there. Should I take this up with Fedora ? Or is there a patch I can apply...
Comment 7 Chris Liddell (chrisl) 2011-12-20 19:56:00 UTC
Well, I think that patch I indicated above was the only fix in this area that was in the Postscript resources, so anything else will mean patching the Ghostcript source, and rebuilding the binary.

Given that, you'll probably need to go through the package maintainer anyway.


Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
Comment 8 Dave Smith 2011-12-20 20:16:42 UTC
(In reply to comment #7)
> Well, I think that patch I indicated above was the only fix in this area that
> was in the Postscript resources, so anything else will mean patching the
> Ghostcript source, and rebuilding the binary.
> 
> Given that, you'll probably need to go through the package maintainer anyway.
> 
> 
> Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.

Opened a ticket at Fedora 


https://bugzilla.redhat.com/show_bug.cgi?id=769436
Comment 9 Dave Smith 2011-12-21 20:59:58 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Well, I think that patch I indicated above was the only fix in this area that
> > was in the Postscript resources, so anything else will mean patching the
> > Ghostcript source, and rebuilding the binary.
> > 
> > Given that, you'll probably need to go through the package maintainer anyway.
> > 
> > 
> > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> 
> Opened a ticket at Fedora 
> 
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=769436


Did you try this on 64 bit or 32 bit? I found this that seems to describe the same problem ...

http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html
Comment 10 Dave Smith 2011-12-21 21:01:18 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Well, I think that patch I indicated above was the only fix in this area that
> > was in the Postscript resources, so anything else will mean patching the
> > Ghostcript source, and rebuilding the binary.
> > 
> > Given that, you'll probably need to go through the package maintainer anyway.
> > 
> > 
> > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> 
> Opened a ticket at Fedora 
> 
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=769436


Did you try this on 64 bit or 32 bit? I found this that seems to describe the same problem ...

http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > Well, I think that patch I indicated above was the only fix in this area that
> > > was in the Postscript resources, so anything else will mean patching the
> > > Ghostcript source, and rebuilding the binary.
> > > 
> > > Given that, you'll probably need to go through the package maintainer anyway.
> > > 
> > > 
> > > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> > 
> > Opened a ticket at Fedora 
> > 
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=769436
> 
> 
> Did you try this on 64 bit or 32 bit? I found this that seems to describe the
> same problem ...
> 
> http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html

Sorry, I forgot to add I downloaded the source from the git repo and build it on Fedora 15 64 bit and got the same error.
Comment 11 Dave Smith 2011-12-21 22:07:05 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Well, I think that patch I indicated above was the only fix in this area that
> > was in the Postscript resources, so anything else will mean patching the
> > Ghostcript source, and rebuilding the binary.
> > 
> > Given that, you'll probably need to go through the package maintainer anyway.
> > 
> > 
> > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> 
> Opened a ticket at Fedora 
> 
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=769436


Did you try this on 64 bit or 32 bit? I found this that seems to describe the same problem ...

http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > Well, I think that patch I indicated above was the only fix in this area that
> > > was in the Postscript resources, so anything else will mean patching the
> > > Ghostcript source, and rebuilding the binary.
> > > 
> > > Given that, you'll probably need to go through the package maintainer anyway.
> > > 
> > > 
> > > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> > 
> > Opened a ticket at Fedora 
> > 
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=769436
> 
> 
> Did you try this on 64 bit or 32 bit? I found this that seems to describe the
> same problem ...
> 
> http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html

Sorry, I forgot to add I downloaded the source from the git repo and build it on Fedora 15 64 bit and got the same error.
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > Well, I think that patch I indicated above was the only fix in this area that
> > > was in the Postscript resources, so anything else will mean patching the
> > > Ghostcript source, and rebuilding the binary.
> > > 
> > > Given that, you'll probably need to go through the package maintainer anyway.
> > > 
> > > 
> > > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> > 
> > Opened a ticket at Fedora 
> > 
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=769436
> 
> 
> Did you try this on 64 bit or 32 bit? I found this that seems to describe the
> same problem ...
> 
> http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html
> (In reply to comment #9)
> > (In reply to comment #8)
> > > (In reply to comment #7)
> > > > Well, I think that patch I indicated above was the only fix in this area that
> > > > was in the Postscript resources, so anything else will mean patching the
> > > > Ghostcript source, and rebuilding the binary.
> > > > 
> > > > Given that, you'll probably need to go through the package maintainer anyway.
> > > > 
> > > > 
> > > > Also, I can't find a list of patches Ubuntu has adopted since our 9.04 release.
> > > 
> > > Opened a ticket at Fedora 
> > > 
> > > 
> > > https://bugzilla.redhat.com/show_bug.cgi?id=769436
> > 
> > 
> > Did you try this on 64 bit or 32 bit? I found this that seems to describe the
> > same problem ...
> > 
> > http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html
> 
> Sorry, I forgot to add I downloaded the source from the git repo and build it
> on Fedora 15 64 bit and got the same error.

I downloaded the source out of git and built on Fedora 15 and get the same error.

Did you try this on 64 bit or 32 bit? I found this that seems to describe the
same problem ...

http://www.ghostscript.com/pipermail/gs-devel/2010-July/008785.html
Comment 12 Chris Liddell (chrisl) 2011-12-21 22:16:03 UTC
I did, but with limited support for the display device, I only got it to run the file without the ICC profile error, I didn't try any further.

Now I have, and it seems there's a little "hiccup". I haven't a clue how this worked on 8.x, but......

It seems that, because one of the things DisplayHandle can be is a pointer value, and on 64 bit builds, that can (obviously!) be longer than 32 bits. But Postscript only allows 32 bit number values, and these settings work through the Postscript machinery, it needs to be compatible with that limitation.

So, on 64 bit systems the parameter for DisplayHandle is expected to be a string, rather than an integer or a long. So, if you convert your DisplayHandle parameter to a string, and use

-sDisplayHandle="handle value string"


That *might* help.
Comment 13 Dave Smith 2011-12-21 22:23:20 UTC
(In reply to comment #12)
> I did, but with limited support for the display device, I only got it to run
> the file without the ICC profile error, I didn't try any further.
> 
> Now I have, and it seems there's a little "hiccup". I haven't a clue how this
> worked on 8.x, but......
> 
> It seems that, because one of the things DisplayHandle can be is a pointer
> value, and on 64 bit builds, that can (obviously!) be longer than 32 bits. But
> Postscript only allows 32 bit number values, and these settings work through
> the Postscript machinery, it needs to be compatible with that limitation.
> 
> So, on 64 bit systems the parameter for DisplayHandle is expected to be a
> string, rather than an integer or a long. So, if you convert your DisplayHandle
> parameter to a string, and use
> 
> -sDisplayHandle="handle value string"
> 
> 
> That *might* help.

Did not work, tried -dDisplayHandle="0". The reason I brought this back up is that I installed 64 bit 8.71 and it failed with the same error. All my running installs are 32 bit, this is the first crack at 64 bit....
Comment 14 Chris Liddell (chrisl) 2011-12-21 22:25:15 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > I did, but with limited support for the display device, I only got it to run
> > the file without the ICC profile error, I didn't try any further.
> > 
> > Now I have, and it seems there's a little "hiccup". I haven't a clue how this
> > worked on 8.x, but......
> > 
> > It seems that, because one of the things DisplayHandle can be is a pointer
> > value, and on 64 bit builds, that can (obviously!) be longer than 32 bits. But
> > Postscript only allows 32 bit number values, and these settings work through
> > the Postscript machinery, it needs to be compatible with that limitation.
> > 
> > So, on 64 bit systems the parameter for DisplayHandle is expected to be a
> > string, rather than an integer or a long. So, if you convert your DisplayHandle
> > parameter to a string, and use
> > 
> > -sDisplayHandle="handle value string"
> > 
> > 
> > That *might* help.
> 
> Did not work, tried -dDisplayHandle="0". The reason I brought this back up is
> that I installed 64 bit 8.71 and it failed with the same error. All my running
> installs are 32 bit, this is the first crack at 64 bit....

-sDisplayHandle="handle value string"
^^


Not -d.....
Comment 15 Dave Smith 2011-12-21 23:16:08 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > (In reply to comment #12)
> > > I did, but with limited support for the display device, I only got it to run
> > > the file without the ICC profile error, I didn't try any further.
> > > 
> > > Now I have, and it seems there's a little "hiccup". I haven't a clue how this
> > > worked on 8.x, but......
> > > 
> > > It seems that, because one of the things DisplayHandle can be is a pointer
> > > value, and on 64 bit builds, that can (obviously!) be longer than 32 bits. But
> > > Postscript only allows 32 bit number values, and these settings work through
> > > the Postscript machinery, it needs to be compatible with that limitation.
> > > 
> > > So, on 64 bit systems the parameter for DisplayHandle is expected to be a
> > > string, rather than an integer or a long. So, if you convert your DisplayHandle
> > > parameter to a string, and use
> > > 
> > > -sDisplayHandle="handle value string"
> > > 
> > > 
> > > That *might* help.
> > 
> > Did not work, tried -dDisplayHandle="0". The reason I brought this back up is
> > that I installed 64 bit 8.71 and it failed with the same error. All my running
> > installs are 32 bit, this is the first crack at 64 bit....
> 
> -sDisplayHandle="handle value string"
> ^^
> 
> 
> Not -d.....

Good news and bad news...

From the command line no errors.
When I try to call it from the GS API (so in my case) I get

Unrecoverable error: rangecheck in .putdeviceprops

This is the case in my working 32 bit version and the 64 bit ...
Comment 16 Chris Liddell (chrisl) 2011-12-21 23:39:40 UTC
(In reply to comment #15)
> 
> Good news and bad news...
> 
> From the command line no errors.
> When I try to call it from the GS API (so in my case) I get
> 
> Unrecoverable error: rangecheck in .putdeviceprops
> 
> This is the case in my working 32 bit version and the 64 bit ...

Well, you have a couple of options. Since you seem reasonably confident with such things, you could build yourself a debug build of the Ghostscript .so lib, and put a break point in display_put_params() and step through to find where/why it throws an error (assuming it is the display device put_params that throws the erro, and not the generic code).

OR, if you could throw together a simple test harness which reproduces how you are driving Ghostscript in your app, I, or one of us, can look into what's causing the error.

Clealy, *our* implementations work a bit differently, so aren't driving this stuff in the same way as yours.
Comment 17 Dave Smith 2011-12-22 08:30:17 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > 
> > Good news and bad news...
> > 
> > From the command line no errors.
> > When I try to call it from the GS API (so in my case) I get
> > 
> > Unrecoverable error: rangecheck in .putdeviceprops
> > 
> > This is the case in my working 32 bit version and the 64 bit ...
> 
> Well, you have a couple of options. Since you seem reasonably confident with
> such things, you could build yourself a debug build of the Ghostscript .so lib,
> and put a break point in display_put_params() and step through to find
> where/why it throws an error (assuming it is the display device put_params that
> throws the erro, and not the generic code).
> 
> OR, if you could throw together a simple test harness which reproduces how you
> are driving Ghostscript in your app, I, or one of us, can look into what's
> causing the error.
> 
> Clealy, *our* implementations work a bit differently, so aren't driving this
> stuff in the same way as yours.

I finally figured out what the difference between -s and -d mean and it works fine. 

May I suggest that the documentation here 
http://ghostscript.com/doc/current/API.htm#display

be updated from 

The callbacks are for device open, close, resize, sync, page, memory allocation and updating. Each callback function contains a handle can be set using

    -dDisplayHandle=1234 

to 

 -sDisplayHandle=1234 

and 

this code fragment

sprintf(arg2, "-dDisplayHandle=%d", 0);

be changed to 

sprintf(arg2, "-sDisplayHandle=%d", 0);


From the source code this seems to be the preferred way and for me it works on both 32 bit and 64 bit ghostscript, from versions 8.64 upwards ...
Comment 18 Chris Liddell (chrisl) 2011-12-22 08:36:10 UTC
Great, thanks for confirming.

I'll look at updating the documentation before the next release (note: the correct information is actually in gdevdsp.h - I'd always suggest checking relevant header files, since documentation does tend to rot over time).

*** This bug has been marked as a duplicate of bug 692532 ***