Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 Ensure mogrify output is depth 8

closed
nobody
None
5
2007-03-30
2007-01-20
Chris Mayo
No

tiff2pdf can't cope with 16bit tiff's - which mogrify will create by default if ImageMagick version is Q16.

This patch makes sure mogrify outputs 8 bit tiff's.

Discussion

  • Logged In: YES
    user_id=1191635
    Originator: NO

    Thanks for the patch. However, I can't use the patch as is, as it would force ALL TIFFs to be 8 bit, and I, for instance, use 2 bit scans quite a bit.

    I have, though, put in a check for the image depth, and pass the result to mogrify.

    This will be in the next release.

     
    • status: open --> closed
     
  • Chris Mayo
    Chris Mayo
    2007-01-29

    Logged In: YES
    user_id=808349
    Originator: YES

    Looking at the CVS:

    2685 # Rotate the tiff with imagemagick
    2686 if (`$cmd` =~ /Bits\/Sample: (\d*)/) {
    2687 system("mogrify -depth $1 -rotate $degrees ".$slist -> {data}[$page[$i]][2]);
    2688 }
    2689 else {
    2690 system("mogrify -rotate $degrees ".$slist -> {data}[$page[$i]][2]);
    2691 }

    I think the else mogrify in 2690 needs -depth 8. Otherwise if you have ImageMagick Q16 this will create a depth 16 image, if you have Q8 you get depth 8 either way.

     
  • Chris Mayo
    Chris Mayo
    2007-01-29

    • status: closed --> open
     
  • Logged In: YES
    user_id=1191635
    Originator: NO

    I don't think that this is necessarily Q16. I have Q16 on my Ubuntu Edgy machine, and don't see the bug.

    And I'm not sure that I have fixed it properly, either, because I'm not convinced that the Bits/Sample output from tiffinfo is the depth.

    I could use identify -verbose, but that takes a *LONG* time to run.

    Any ideas on a quicker way of digging out the depth?

     
  • Chris Mayo
    Chris Mayo
    2007-02-06

    Logged In: YES
    user_id=808349
    Originator: YES

    I've rechecked with mogrify -rotate on the command line and I still see the same (only with tiff though, jpg's stay at depth 8).

    I think tiffinfo is fine, I don't think you will do better from shell. The only other one I can think of is ImageMagick's identify. Of course using perlmagick would open up all sorts of possibilities!

     
  • Logged In: YES
    user_id=1191635
    Originator: NO

    Can you check that tiffinfo is correctly identifying the depth, then?
    It rather indicates that tiffinfo is reporting the wrong depth.

     
  • Logged In: YES
    user_id=1191635
    Originator: NO

    In CVS, I have switched from tiff2pdf to PDF::API2, so I hope the problem will go away.

     
    • status: open --> closed