stream corrupts files

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
Juce
Posts: 12
Joined: 2011-03-22T07:06:04-07:00
Authentication code: 8675308
Location: Finland

stream corrupts files

Post by Juce »

It seems that the stream does not properly handle situations where it can not write to a file.

Code: Select all

stream -map rgb -storage-type char *.sgi - | x264 - -o testi.mkv --demuxer raw --input-csp rgb --input-res 1280x720 --fps 50 --quiet --frames 10

raw [info]: 1280x720p 0:0 @ 50/1 fps (cfr)
resize [warning]: converting from rgb24 to yuv420p
[swscaler @ 003e4840] full chroma interpolation for destination format 'yuv420p' not yet implemented

encoded 10 frames, 2.96 fps, 3971.32 kb/s
stream.exe: Improper image header `05149.sgi' @ error/sgi.c/ReadSGIImage/327.
stream.exe: Improper image header `05618.sgi' @ error/sgi.c/ReadSGIImage/327.
Files: ftp://vqeg.its.bldrdoc.gov/HDTV/SVT_Mul ... R_SVTdec05_/

stream -version
Version: ImageMagick 6.7.3-6 2011-11-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

Windows XP 32-bit, x264 r2106 (x264.nl)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: stream corrupts files

Post by anthony »

stream outputs raw RGB data.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Juce
Posts: 12
Joined: 2011-03-22T07:06:04-07:00
Authentication code: 8675308
Location: Finland

Re: stream corrupts files

Post by Juce »

Sorry. I tested above commands again and corruption does not happened. Maybe this bug is difficult to repeat.

This is a easier repeatable example:

Code: Select all

stream -map rgb -storage-type short images\logo.png - | echo abc

abc
stream.exe: IDAT: CRC error `images\logo.png' @ error/png.c/MagickPNGErrorHandler/1728.
stream.exe: Corrupt image `images\logo.png' @ error/png.c/ReadPNGImage/3695.
stream.exe: missing an image filename `images\logo.png' @ error/stream.c/StreamImageCommand/767.
anthony wrote:stream outputs raw RGB data.
This is exactly what I want.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: stream corrupts files

Post by anthony »

Code: Select all

convert rose: rose.png
stream -map rgb -storage-type short rose.png - >/dev/null
No errors no problems! Perhaps your PNG file is actually corrupted?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Juce
Posts: 12
Joined: 2011-03-22T07:06:04-07:00
Authentication code: 8675308
Location: Finland

Re: stream corrupts files

Post by Juce »

Tested on another PC (Windows 7) with http://www.imagemagick.org/download/bin ... indows.zip and the same error appears.

Code: Select all

convert images\logo.png image.bmp
works without any errors.

rose: is too small for testing.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: stream corrupts files

Post by anthony »

can you give us a link to the PNG image you are using?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Juce
Posts: 12
Joined: 2011-03-22T07:06:04-07:00
Authentication code: 8675308
Location: Finland

Re: stream corrupts files

Post by Juce »

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: stream corrupts files

Post by anthony »

Note that imageshack has an annoying tendancy to modify the images it serves!

I recommend you use a file service that exports the file AS IS. such as dropbox.

However.. this display the image output from stream fine...

Code: Select all

  stream -map rgb -storage-type short logopx.png - | convert -depth 16 -size 2135x2048 rgb:- show:
The black areas are normally hidden by transparency which stream is ignoring.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Juce
Posts: 12
Joined: 2011-03-22T07:06:04-07:00
Authentication code: 8675308
Location: Finland

Re: stream corrupts files

Post by Juce »

Have you tried these in Windows with 32-bit binaries?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: stream corrupts files

Post by anthony »

Sorry no. I am not a windows user. I can barely find the control panel in windows!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply