Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post by 246246 »

Code: Select all

c:\>set MAGICK_TMPDIR=C:/WINDOWS/TEMP

c:\>convert -version
Version: ImageMagick 6.9.1-10 Q16 x86 2015-07-25 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

c:\>convert rose: PNG:- | identify -quiet -
-=>C:/WINDOWS/TEMP/magick-7368uBkzxXLBcBZC PNG 70x46 70x46+0+0 8-bit sRGB 6.97KB 0.000u 0:00.002

c:\>convert rose: PNG8:- | identify -quiet -
-=>C:/WINDOWS/TEMP/magick-1560lOhfVRfBpUOF PNG 70x46 70x46+0+0 8-bit sRGB 113c 2.17KB 0.000u 0:00.003

c:\>convert rose: PNG24:- | identify -quiet -
-=>C:/WINDOWS/TEMP/magick-7312cg0RIMk4ko-c PNG 70x46 70x46+0+0 8-bit sRGB 6.97KB 0.000u 0:00.001

c:\>convert rose: PNG32:- | identify -quiet -
-=>C:/WINDOWS/TEMP/magick-81287gdAE8f9mxlN PNG 70x46 70x46+0+0 8-bit sRGB 7.96KB 0.000u 0:00.002

c:\>convert rose: PNG48:- | identify -quiet -
convert.exe: unable to open image `PNG48:-': Permission denied @ error/blob.c/OpenBlob/2695.
identify.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.

c:\>convert rose: PNG64:- | identify -quiet -
convert.exe: unable to open image `PNG64:-': Permission denied @ error/blob.c/OpenBlob/2695.
identify.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.

c:\>convert rose: PNG00:- | identify -quiet -
convert.exe: unable to open image `PNG00:-': Permission denied @ error/blob.c/OpenBlob/2695.
identify.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
I instaled ImageMagick to D:\Program Files\ImageMagick-6.9.1-Q16-HDRI from binary release file ImageMagick-6.9.1-10-Q16-HDRI-x86-dll.exe, and if I invoked the same command from D:\, one error from convert disappears, but still no output to STDOUT.

Code: Select all

c:\>cd /d d:/

d:\>convert rose: PNG48:- | identify -quiet -
identify.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
All works well if output is a file.

Code: Select all

C:\>convert rose: PNG48:tmp.png

C:\>identify tmp.png
tmp.png PNG 70x46 70x46+0+0 16-bit sRGB 12.1KB 0.000u 0:00.000
And it works on 6.1.9-3 on Cygwin.

Code: Select all

$ convert -version
Version: ImageMagick 6.9.1-3 Q16 i686 2015-06-21 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: DPC OpenMP
Delegates (built-in): autotrace bzlib cairo fftw fontconfig freetype fpx gslib jbig jng jpeg lcms lzma pangocairo png ps rsvg tiff webp x xml zlib

$ convert rose: PNG48:- | identify -
-=>/tmp/magick-7108qVNjdMYJvCF0 PNG 70x46 70x46+0+0 16-bit sRGB 12.1KB 0.000u 0:00.003

$ convert rose: PNG64:- | identify -
-=>/tmp/magick-7776cq7NOy1RWsjA PNG 70x46 70x46+0+0 16-bit sRGB 12.5KB 0.016u 0:00.003

$ convert rose: PNG00:- | identify -
-=>/tmp/magick-7280fDJHIEdoySGf PNG 70x46 70x46+0+0 8-bit sRGB 6.97KB 0.000u 0:00.003
Is it a Windows specific problem or issue on newer version?

Best Wishes,
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post by snibgo »

Your tests pass on v6.9.1--6, Q16 integer, pre-built binary.

I suspect the bug was introduced in a later version. I don't have later versions.

As this seems to be a bug, I'll move it to the bugs forum.
snibgo's IM pages: im.snibgo.com
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post by glennrp »

6.9.1-9 and 6.9.10 work for me. Note that the PNG00, PNG48, and PNG64 subformats were added at version 6.8.2-0, so I'd expect to see what you saw if running a version older than that.

Maybe there's something going on behind the scenes that causes "convert -version" to report the current version but the PNG decoder is coming from an older version. That is to say, you're picking up the current version.h but an older executable.

What does

Code: Select all

convert -list format | grep PNG
identify -list format | grep PNG
say? Are PNG00, PNG48, and PNG64 among the listed formats for both commands? I suppose they are, because you said that PNG48 worked for you when directing the output to a file.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post by dlemstra »

This is not a Windows only bug but a 'Modules' only bug. Your Cygwin 6.9.1-3 version is statically linked instead of compiled with 'Modules' enabled. I will commit a fix for this tomorrow and this will work properly in the next version of ImageMagick (6.9.2-0)
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post by 246246 »

I rechecked after newly installed to C:
glennrp wrote: What does

Code: Select all

convert -list format | grep PNG
identify -list format | grep PNG
say? Are PNG00, PNG48, and PNG64 among the listed formats for both commands? I suppose they are, because you said that PNG48 worked for you when directing the output to a file.
Yes, all are there.

Code: Select all

C:\>convert -list format | find "PNG"
      JNG* PNG       rw-   JPEG Network Graphics
      MNG* PNG       rw+   Multiple-image Network Graphics (libpng 1.6.17)
      PNG* PNG       rw-   Portable Network Graphics (libpng 1.6.17)
           See http://www.libpng.org/ for details about the PNG format.
    PNG00* PNG       rw-   PNG inheriting bit-depth, color-type from original if possible
    PNG24* PNG       rw-   opaque or binary transparent 24-bit RGB (zlib 1.2.8)
    PNG32* PNG       rw-   opaque or transparent 32-bit RGBA
    PNG48* PNG       rw-   opaque or binary transparent 48-bit RGB
    PNG64* PNG       rw-   opaque or transparent 64-bit RGBA
     PNG8* PNG       rw-   8-bit indexed with optional binary transparency

C:\>identify -list format | find "PNG"
      JNG* PNG       rw-   JPEG Network Graphics
      MNG* PNG       rw+   Multiple-image Network Graphics (libpng 1.6.17)
      PNG* PNG       rw-   Portable Network Graphics (libpng 1.6.17)
           See http://www.libpng.org/ for details about the PNG format.
    PNG00* PNG       rw-   PNG inheriting bit-depth, color-type from original if possible
    PNG24* PNG       rw-   opaque or binary transparent 24-bit RGB (zlib 1.2.8)
    PNG32* PNG       rw-   opaque or transparent 32-bit RGBA
    PNG48* PNG       rw-   opaque or binary transparent 48-bit RGB
    PNG64* PNG       rw-   opaque or transparent 64-bit RGBA
     PNG8* PNG       rw-   8-bit indexed with optional binary transparency
dlemstra wrote:This is not a Windows only bug but a 'Modules' only bug.
Seems to be exactly right. it searches IM_MOD_RL_PNG48_.dll

Code: Select all

C:\>(convert -debug "Module" rose: PNG48:- 1>NUL)2>&1
2015-07-27T10:21:24+09:00 0:00.007 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "MAGICK" using filename "IM_MOD_RL_MAGICK_.dll"
2015-07-27T10:21:24+09:00 0:00.018 0.000u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_MAGICK_.dll" ...
2015-07-27T10:21:24+09:00 0:00.027 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1277/Module
  Opening module at path "C:\Program Files\ImageMagick-6.9.1-Q16-HDRI\modules\coders\IM_MOD_RL_MAGICK_.dll"
2015-07-27T10:21:24+09:00 0:00.040 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1304/Module
  Method "RegisterMAGICKImage" in module "MAGICK" at address 6FB11110
2015-07-27T10:21:25+09:00 0:00.053 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1318/Module
  Method "UnregisterMAGICKImage" in module "MAGICK" at address 6FB112B0
2015-07-27T10:21:25+09:00 0:00.065 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNM" using filename "IM_MOD_RL_PNM_.dll"
2015-07-27T10:21:25+09:00 0:00.078 0.000u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNM_.dll" ...
2015-07-27T10:21:25+09:00 0:00.088 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1277/Module
  Opening module at path "C:\Program Files\ImageMagick-6.9.1-Q16-HDRI\modules\coders\IM_MOD_RL_PNM_.dll"
2015-07-27T10:21:25+09:00 0:00.100 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1304/Module
  Method "RegisterPNMImage" in module "PNM" at address 71713B40
2015-07-27T10:21:25+09:00 0:00.112 0.000u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1318/Module
  Method "UnregisterPNMImage" in module "PNM" at address 71713F70
2015-07-27T10:21:25+09:00 0:00.126 0.016u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNG48" using filename "IM_MOD_RL_PNG48_.dll"
2015-07-27T10:21:25+09:00 0:00.136 0.016u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNG48_.dll" ...
2015-07-27T10:21:25+09:00 0:00.158 0.031u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNG48" using filename "IM_MOD_RL_PNG48_.dll"
2015-07-27T10:21:25+09:00 0:00.169 0.031u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNG48_.dll" ...
2015-07-27T10:21:25+09:00 0:00.177 0.047u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNG48" using filename "IM_MOD_RL_PNG48_.dll"
2015-07-27T10:21:25+09:00 0:00.183 0.047u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNG48_.dll" ...
2015-07-27T10:21:25+09:00 0:00.195 0.047u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNG48" using filename "IM_MOD_RL_PNG48_.dll"
2015-07-27T10:21:25+09:00 0:00.201 0.047u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNG48_.dll" ...
2015-07-27T10:21:25+09:00 0:00.206 0.047u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNG48" using filename "IM_MOD_RL_PNG48_.dll"
2015-07-27T10:21:25+09:00 0:00.211 0.047u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNG48_.dll" ...
2015-07-27T10:21:25+09:00 0:00.216 0.047u 6.9.1 Module convert.exe[3368]: module.c/OpenModule/1268/Module
  Searching for module "PNG48" using filename "IM_MOD_RL_PNG48_.dll"
2015-07-27T10:21:25+09:00 0:00.221 0.047u 6.9.1 Module convert.exe[3368]: module.c/GetMagickModulePath/554/Module
  Searching for coder module file "IM_MOD_RL_PNG48_.dll" ...
Thank you for your fast reply.
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: Cannot output png to STDOUT if prefix is PNG48, PNG64 or PNG00 on Windows

Post by 246246 »

Confirmed to work in 6.9.2-0 with pre-build dll version of Windows.
Thank you.
Post Reply