View Issue Details

IDProjectCategoryView StatusLast Update
0000612filegeneralpublic2017-05-08 20:19
ReporterDavid Griffith 
Assigned ToChristos Zoulas 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version5.30 
Target VersionFixed in Version 
Summary0000612: G3 fax image files generated by ImageMagick aren't recognized by file(1)
DescriptionCreate a G3 fax image file with ImageMagick by doing "convert foobar.gif foobar.g3". The resulting file will be recognized only as "data". However, this file is recognized as a G3 fax image when I patched the xv image viewer to read G3 files.

See https://github.com/DavidGriffith/xv for the modified xv source code. Please note that the G3 code was written by Jean-Pierre Demailly who submitted a patch to Greg Roelofs.
TagsNo tags attached.

Relationships

Activities

Christos Zoulas

Christos Zoulas

2017-05-04 17:46

manager   ~0001509

[1:44pm] 52>file 1.gif
1.gif: GIF image data, version 89a, 39 x 46
[1:45pm] 53>magick convert 1.gif 1.g3
convert: unable to access configure file `magic.xml' @ warning/configure.c/GetConfigureOptions/715.
[1:45pm] 54>file 1.g3
1.g3: raw G3 (Group 3) FAX
[1:45pm] 55>file -v
file-5.30
magic file from /usr/share/misc/magic
[1:45pm] 56>

Works here. Can you supply an example gif and coverted file that does not work?
David Griffith

David Griffith

2017-05-04 20:24

reporter  

tinydisk.g3 (699,967 bytes)
tinydisk.jpg (283,868 bytes)
David Griffith

David Griffith

2017-05-04 20:24

reporter   ~0001510

Erp.. I meant jpeg.
Christos Zoulas

Christos Zoulas

2017-05-08 20:15

manager   ~0001514

If you look in the "modem" file there have been several fruitless attempts to deal with g3 since there is no header information:
# unusual image starting with black pixel
#0 short 0x1300 raw G3 (Group 3) FAX
0 short 0x1400
# 16 0-bits near beginning like PicturePuzzler found on Golden Orchard Apple CD
Rom
>2 search/9 \0\0
# maximal 7 0-bits for pixel sequences or 11 0-bits for EOL in G3
>2 default x raw G3 (Group 3) FAX
# version 5.25 labeled the above entry as "raw G3 data"
!:mime image/g3fax
!:ext g3
# unusual image with black pixel near beginning
#0 short 0x1900 raw G3 (Group 3) FAX

Your file starts with 0x001f which is not the usual 0x0014 that the magic file recognizes (which probably means that your file has more "black" at the top than usual. Changing the magic to something like "0 short &0xf0ff=0x1000 will work, for the first byte, but then it will not find the string of 0's later and 12 bits of magic is really too weak (it will produce spurious matches).

Issue History

Date Modified Username Field Change
2017-05-03 23:09 David Griffith New Issue
2017-05-04 17:46 Christos Zoulas Note Added: 0001509
2017-05-04 20:24 David Griffith File Added: tinydisk.jpg
2017-05-04 20:24 David Griffith File Added: tinydisk.g3
2017-05-04 20:24 David Griffith Note Added: 0001510
2017-05-08 20:15 Christos Zoulas Note Added: 0001514
2017-05-08 20:19 Christos Zoulas Assigned To => Christos Zoulas
2017-05-08 20:19 Christos Zoulas Status new => assigned