Image corrupted when converted to pixel cache

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
balaprassanna
Posts: 5
Joined: 2018-06-11T02:46:14-07:00
Authentication code: 1152

Image corrupted when converted to pixel cache

Post by balaprassanna »

I have an image which is converted to pixel cache format .mpc and then resized to 1600x1600 using the following commands

convert image.png pixelcache.mpc

convert pixelcache.mpc -resize 1600x1600\> resized.png

The resized.png image looks different in the latest version of imagemagick (v7.0.7-38). However, this works in older versions of imagemagick (v7.0.5-4).

https://drive.google.com/open?id=1Z3d1d ... BFD1dPu2Ta
Last edited by balaprassanna on 2018-06-11T23:49:15-07:00, edited 3 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image corrupted when converted to pixel cache

Post by snibgo »

-resize\>
Why do you have a ">"? That is bad syntax, in v6 and v7.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image corrupted when converted to pixel cache

Post by fmw42 »

Perhaps you want -resize 1600x1600\> or "1600x1600>"

See http://www.imagemagick.org/script/comma ... p#geometry
balaprassanna
Posts: 5
Joined: 2018-06-11T02:46:14-07:00
Authentication code: 1152

Re: Image corrupted when converted to pixel cache

Post by balaprassanna »

This is the right command being used. The resized.png looks different from the original image.
convert pixelcache.mpc -resize 1600x1600\> resized.png

This one is a typographical error. I have edited my question.
convert pixelcache.mpc -resize\> 1600x1600 resized.png
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image corrupted when converted to pixel cache

Post by snibgo »

balaprassanna wrote:... looks different ...
Please be more precise. In what way does it look different?
snibgo's IM pages: im.snibgo.com
balaprassanna
Posts: 5
Joined: 2018-06-11T02:46:14-07:00
Authentication code: 1152

Re: Image corrupted when converted to pixel cache

Post by balaprassanna »

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image corrupted when converted to pixel cache

Post by fmw42 »

If the mpc file comes from a different version of ImageMagick, it may not work on your current version. Also do you have the corresponding .cache file in the same location as the .mpc file?
balaprassanna
Posts: 5
Joined: 2018-06-11T02:46:14-07:00
Authentication code: 1152

Re: Image corrupted when converted to pixel cache

Post by balaprassanna »

The mpc file is being generated by the same version of imagemagick. Yes, i have the .cache file in the same directory as .mpc file. This is working in the older version v7.0.5-4
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Image corrupted when converted to pixel cache

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick within a few days. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ within a few days.
balaprassanna
Posts: 5
Joined: 2018-06-11T02:46:14-07:00
Authentication code: 1152

Re: Image corrupted when converted to pixel cache

Post by balaprassanna »

Can you explain what went wrong or share the changeset. So that we will have an insight if we face something similar again.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Image corrupted when converted to pixel cache

Post by magick »

The problem was a bug in the PNG coder. The image attributes did not match the morphology of the image pixels.
Post Reply