Package: libmagic1
Version: 5.11-2+deb7u3

### first lets create a demo image.
bash$ cat >source_ascii.pbm <<EOF
P1
20 10
0001000000000000001000010000000000000010000110000001111000100000100011
1001100011000000000000110000010000000011001100000011110000010001111000
000000011000000001110000000110000000001100000001000000000010
EOF

### convert it to binary pbm because the other tools don't like ascii
### input.
bash$ pgmtopbm source_ascii.pbm > source.pbm

### please install jbigkit-bin 2.0-2+deb7u1
### lets create JBIG and JBIG2 files from our original image:
bash$ pbmtojbg source.pbm > comp.jbg
bash$ pbmtojbg85 source.pbm > comp.jbg85

### try to display these images.
### gimp fails on both, but imageMagick can display one of them:
bash$ display comp.jbg  # display from ImageMagick. works!
bash$ display comp.jbg85  # does not detect image format :-(

### lets now convert the JBIG images back to original:
bash$ jbgtopbm comp.jbg | pgmtopbm > back.pbm
bash$ jbgtopbm comp.jbg85 | pgmtopbm > back85.pbm

### now compare original to decompressed images
bash$ md5sum *|sort
  you see that back85.pbm, back.pbm, source.pbm are equal.

so compression and decompression of jbg and jbg85 are working.
they even do for larger source images.

I was thinking about replacing TIFF-G4 compressed images by JBIG or
JBIG2 compressed images because they have much better compression ratio,
but as images are stored as files, it is necessary that the filetype is
detected by libmagic.

and here is the bug / wishlist:

bash$ file *
back85.pbm:       Netpbm PBM "rawbits" image data <-- OK
back.pbm:         Netpbm PBM "rawbits" image data <-- OK
comp.jbg:         MS Windows icon resource          <-- wrong!
comp.jbg85:       MS Windows icon resource          <-- wrong!
source_ascii.pbm: Netpbm PBM image, ASCII text    <-- OK
source.pbm:       Netpbm PBM "rawbits" image data <-- OK


cu
erik


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to