Re: CALL for DISCUSSION: eXIf 20170115

Willem van Schaik <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <[email protected]>
I was looking into the zlib code yesterday and looked into example.c

that one is including enflate/deflate from/to memory

does this help?

Willem


On 2017-01-24 14:31, GLENN PEHRSON wrote:
>
>> On January 24, 2017 at 2:24 PM John Bowler <[email protected]> wrote:
>> I can only conclude that Glenn hasn't
>> actually implemented anything.
>>
>> The issue with zpipe, on both the compress and decompress side, is
>> that it *writes* the output to a *stream*.  This doesn't work because
>> on both read and write the length has to be known *before* the
>> operation starts.  The result of changing it to make this happen is
>> more than 50 lines.
>
> Obviously I had to work around the *stream* problem.
>
> I'm not ready to release the code due to other pressing issues
> today.  Attached is the log from an imagemagick decoding of
> a "zxIf"-containing demo file
> from http://www.simplesystems.org/users/glennrp/eXIf/willem
>
> Script started on Tue 24 Jan 2017 04:13:20 PM EST
> glenn.rp> pngcheck -v *zxIf.png
> File: exif2c08_zxIf.png (2872 bytes)
>   chunk IHDR at offset 0x0000c, length 13
>     32 x 32 image, 24-bit RGB, non-interlaced
>   chunk zxIf at offset 0x00025, length 623
>     unknown private, ancillary, safe-to-copy chunk
>   chunk IDAT at offset 0x002a0, length 2180
>     zlib: deflated, 4K window, maximum compression
>   chunk IEND at offset 0x00b30, length 0
> No errors detected in exif2c08_zxIf.png (4 chunks, 6.5% compression).
> glenn.rp> im identify -verbose -debug coder -log %e exif2c08_zxIf.png
> Enter ReadPNGImage()
>   Enter ReadOnePNGImage()
>     IM version     = 7.0.4-5
>     Libpng version = 1.2.54
>     Zlib version   = 1.2.8
>     Before reading:
>       image->alpha_trait=0      image->rendering_intent=2
>       image->colorspace=23
>       image->gamma=0.454545
>     read_user_chunk: found zxIf chunk
>      recognized uxIf|zxIf chunk
>      initialized uxIf|zxIf chunk
>      chunk->data[0]=0
>     PNG width: 32, height: 32
>     PNG color_type: 2, bit_depth: 8
>     PNG compression_method: 0
>     PNG interlace_method: 0, filter_method: 0
>     Setting sRGB as if in input
>     image->colorspace=23
>     Reading PNG IDAT chunk(s)
>     Converting PNG pixels to pixel packets
>     Looking for cheap transparent pixel
>     No transparent pixel was found
>   image->storage_class=1
>   exit ReadOnePNGImage()
>   page.w: 0, page.h: 0,page.x: 0, page.y: 0.
>   image->colorspace: 23
> exit ReadPNGImage()
> Image: exif2c08_zxIf.png
>   Format: PNG (Portable Network Graphics)
>   Mime type: image/png
>   Class: DirectClass
>   Geometry: 32x32+0+0
>   Resolution: 72x72
>   Print size: 0.444444x0.444444
>   Units: PixelsPerInch
>   Type: TrueColor
>   Endianess: Undefined
>   Colorspace: sRGB
>   Depth: 8-bit
>   Channel depth:
>     Red: 8-bit
>     Green: 8-bit
>     Blue: 8-bit
>   Channel statistics:
>     Pixels: 1024
>     Red:
>       min: 97 (0.380392)
>       max: 255 (1)
>       mean: 212.585 (0.833667)
>       standard deviation: 45.6924 (0.179186)
>       kurtosis: -0.528099
>       skewness: -0.917738
>       entropy: 0.863823
>     Green:
>       min: 184 (0.721569)
>       max: 255 (1)
>       mean: 235.059 (0.921798)
>       standard deviation: 20.684 (0.0811136)
>       kurtosis: -0.840804
>       skewness: -0.729286
>       entropy: 0.845184
>     Blue:
>       min: 66 (0.258824)
>       max: 167 (0.654902)
>       mean: 118.676 (0.465395)
>       standard deviation: 15.3684 (0.0602683)
>       kurtosis: 0.275875
>       skewness: 0.0264405
>       entropy: 0.919218
>   Image statistics:
>     Overall:
>       min: 66 (0.258824)
>       max: 255 (1)
>       mean: 188.773 (0.740287)
>       standard deviation: 30.2865 (0.11877)
>       kurtosis: 16.972
>       skewness: -2.00134
>       entropy: 0.876075
>   Colors: 958
>   Histogram:
>          1: ( 97,215,121) #61D779 srgb(97,215,121)
>   [...]
>          1: (255,255,145) #FFFF91 srgb(255,255,145)
>   Rendering intent: Perceptual
>   Gamma: 0.454545
>   Chromaticity:
>     red primary: (0.64,0.33)
>     green primary: (0.3,0.6)
>     blue primary: (0.15,0.06)
>     white point: (0.3127,0.329)
>   Alpha color: grey74
>   Background color: white
>   Border color: srgb(223,223,223)
>   Transparent color: none
>   Interlace: None
>   Intensity: Undefined
>   Compose: Over
>   Page geometry: 32x32+0+0
>   Dispose: Undefined
>   Iterations: 0
>   Compression: Zip
>   Orientation: TopLeft
>   Properties:
>     date:create: 2017-01-23T23:53:44-05:00
>     date:modify: 2017-01-23T23:53:44-05:00
>     exif:ColorSpace: 65535
>     exif:ComponentsConfiguration: 1, 2, 3, 0
>     exif:Copyright: 2017 Willem van Schaik
>     exif:ExifOffset: 138
>     exif:ExifVersion: 48, 50, 50, 48
>     exif:FlashPixVersion: 48, 49, 48, 48
>     exif:Orientation: 1
>     exif:ResolutionUnit: 2
>     exif:thumbnail:Compression: 6
>     exif:thumbnail:JPEGInterchangeFormat: 314
>     exif:thumbnail:JPEGInterchangeFormatLength: 663
>     exif:thumbnail:ResolutionUnit: 2
>     exif:thumbnail:XResolution: 72/1
>     exif:thumbnail:YResolution: 72/1
>     exif:UserComment: 65, 83, 67, 73, 73, 0, 0, 0, 80, 110, 103, 83, 117, 105, 116, 101
>     exif:XResolution: 72/1
>     exif:YCbCrPositioning: 1
>     exif:YResolution: 72/1
>     png:IHDR.bit-depth-orig: 8
>     png:IHDR.bit_depth: 8
>     png:IHDR.color-type-orig: 2
>     png:IHDR.color_type: 2 (Truecolor)
>     png:IHDR.interlace_method: 0 (Not interlaced)
>     png:IHDR.width,height: 32, 32
>     png:sRGB: intent=0 (Perceptual Intent)
>     signature: c22dc7f8430b1f787047f2dc4b77faf136ae54956ddb5912b29c1d937f5b315c
>   Profiles:
>     Profile-exif: 629 bytes
> exif(629): 0x00000000: 78696600 004d4d00 2a000000 08000701 12000300  Exif--MM-*----------
> 0x00000190: 00000100 01000001 1a000500 00000100 00006201  -------------------b
> 0x00000320: 1b000500 00000100 00006a01 28000300 00000100  -----------j-(------
> 0x000004b0: 02000002 13000300 00000100 01000082 98000200  --------------------
> 0x00000640: 00001700 00007287 69000400 00000100 00008a00  -------r-i----------
> 0x000007d0: 0000dc00 00004800 00000100 00004800 00000132  -------H-------H----
> 0x00000960: 30313720 57696c6c 656d2076 616e2053 63686169  2017 Willem van Scha
> 0x00000af0: 6b000000 05900000 07000000 04303232 30910100  ik------------0220--
> 0x00000c80: 07000000 04010203 00928600 07000000 10000000  --------------------
> 0x00000e10: cca00000 07000000 04303130 30a00100 03000000  ----------0100------
> 0x00000fa0: 01ffff00 00000000 00415343 49490000 00506e67  ----------ASCII---Pn
> 0x00001130: 53756974 65000601 03000300 00000100 06000001  gSuite--------------
> 0x000012c0: 1a000500 00000100 00012a01 1b000500 00000100  -----------*--------
> 0x00001450: 00013201 28000300 00000100 02000002 01000400  ---2-(--------------
> 0x000015e0: 00000100 00013a02 02000400 00000100 00029700  -------:------------
> 0x00001770: 00000000 00004800 00000100 00004800 000001ff  -------H-------H----
> 0x00001900: d8ffe000 104a4649 46000101 00000100 010000ff  ------JFIF----------
> 0x00001a90: db004300 03020203 02020303 03030403 03040508  ---C----------------
> 0x00001c20: 05050404 050a0707 06080c0a 0c0c0b0a 0b0b0d0e  --------------------
> 0x00001db0: 12100d0e 110e0b0b 10161011 13141515 150c0f17  --------------------
> 0x00001f40: 18161418 12141514 ffdb0043 01030404 05040509  ------------C-------
> 0x000020d0: 05050914 0d0b0d14 14141414 14141414 14141414  --------------------
> 0x00002260: 14141414 14141414 14141414 14141414 14141414  --------------------
> 0x000023f0: 14141414 14141414 14141414 14141414 14ffc000  --------------------
> 0x00002580: 11080008 00080301 22000211 01031101 ffc4001f  ---------"----------
> 0x00002710: 00000105 01010101 01010000 00000000 00000102  --------------------
> 0x000028a0: 03040506 0708090a 0bffc400 b5100002 01030302  --------------------
> 0x00002a30: 04030505 04040000 017d0102 03000411 05122131  ----------}--------!
> 0x00002bc0: 41061351 61072271 14328191 a1082342 b1c11552  1A--Qa-"q-2----#B---
> 0x00002d50: d1f02433 62728209 0a161718 191a2526 2728292a  R--$3br--------%&'()
> 0x00002ee0: 34353637 38393a43 44454647 48494a53 54555657  *456789:CDEFGHIJSTUV
> 0x00003070: 58595a63 64656600 00                          WXYZcdef-
>   Artifacts:
>     verbose: true
>   Tainted: False
>   Filesize: 2.87KB
>   Number pixels: 1.02K
>   Pixels per second: 51.2KB
>   User time: 0.000u
>   Elapsed time: 0:01.019
>   Version: ImageMagick 7.0.4-5 Q16 x86_64 2017-01-22 http://www.imagemagick.org
> glenn.rp> pngcheck -v *xiIf_im.png File: exif2c08_zxiIf_im.png (4217 bytes)
>   chunk IHDR at offset 0x0000c, length 13
>     32 x 32 image, 24-bit RGB, non-interlaced
>   chunk cHRM at offset 0x00025, length 32
>     White x = 0.3127 y = 0.329,  Red x = 0.64 y = 0.33
>     Green x = 0.3 y = 0.6,  Blue x = 0.15 y = 0.06
>   chunk bKGD at offset 0x00051, length 6
>     red = 0x00ff, green = 0x00ff, blue = 0x00ff
>   chunk pHYs at offset 0x00063, length 9: 2834x2834 pixels/meter (72 dpi)
>   chunk zTXt at offset 0x00078, length 490, keyword: Raw profile type exif
>   chunk IDAT at offset 0x0026e, length 2180
>     zlib: deflated, 4K window, maximum compression
>   chunk exIf at offset 0x00afe, length 623
>     unknown private, ancillary, safe-to-copy chunk
>   chunk tEXt at offset 0x00d79, length 37, keyword: date:create
>   chunk tEXt at offset 0x00daa, length 37, keyword: date:modify
>   chunk tEXt at offset 0x00ddb, length 21, keyword: exif:ColorSpace
>   chunk tEXt at offset 0x00dfc, length 39, keyword: exif:ComponentsConfiguration
>   chunk tEXt at offset 0x00e2f, length 37, keyword: exif:Copyright
>   chunk tEXt at offset 0x00e60, length 19, keyword: exif:ExifOffset
>   chunk tEXt at offset 0x00e7f, length 31, keyword: exif:ExifVersion
>   chunk tEXt at offset 0x00eaa, length 35, keyword: exif:FlashPixVersion
>   chunk tEXt at offset 0x00ed9, length 28, keyword: exif:thumbnail:Compression
>   chunk tEXt at offset 0x00f01, length 40, keyword: exif:thumbnail:JPEGInterchangeFormat
>   chunk tEXt at offset 0x00f35, length 46, keyword: exif:thumbnail:JPEGInterchangeFormatLength
>   chunk tEXt at offset 0x00f6f, length 31, keyword: exif:thumbnail:ResolutionUnit
>   chunk tEXt at offset 0x00f9a, length 31, keyword: exif:thumbnail:XResolution
>   chunk tEXt at offset 0x00fc5, length 31, keyword: exif:thumbnail:YResolution
>   chunk tEXt at offset 0x00ff0, length 82, keyword: exif:UserComment
>   chunk tEXt at offset 0x0104e, length 23, keyword: exif:YCbCrPositioning
>   chunk IEND at offset 0x01071, length 0
> No errors detected in exif2c08_zxiIf_im.png (24 chunks, -37.3% compression).
> glenn.rp> exit
> exit
>
> Script done on Tue 24 Jan 2017 04:15:45 PM EST
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> png-mng-misc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/png-mng-misc
>

-- 
Willem van Schaik
[email protected]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.