convert from pcx to pcx turns every pixel to black

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.
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

convert from pcx to pcx turns every pixel to black

Post by Dondon »

Running `convert in.pcx out.pcx` causes a valid out.pcx file with the same dimensions to be generated, but every pixel has been changed to black. This only happens on certain pcx files, though I'm not certain what might be unique about them.

Version: ImageMagick 6.7.5-6 2012-08-11 Q16

Here's a base64 encoding of in.pcx.bz2 which exhibits this bug:

Code: Select all

QlpoOTFBWSZTWVzJrD4AADfr//6QgACFAMIAAACAg8AAgACAEMAI///IgeqI6v/gB58AAAAAAAAA
fBzTEwEaYEYRgAAACYRgc0xMBGmBGEYAAAAmEYHNMTARpgRhGAAAAJhGBzTEwEaYEYRgAAACYRgN
pSgmBPSYAQYRgmAmAIMIFSIgIhNT0yRpMm0mnqNA0bU0GCejapVrnZUepXwPOPoKPYPgaaFNaU46
49NHxvk9fr6nvNTzK8aGCjJRX+iyz2GD0H1Gmkd5RsYPV3T4tJdVUPJosbFA5PEsfUZLFFA6llFk
n5FBJipUpFyiqkTehOePKripgRP2FCB7SUFFG5Qk+UoJEf7KEkMCjxFCFFAfoUIMlBH5lCEUUSIs
VCO41FHrlFZNjQYNzJnzlSvQYORyfw3lStjQn4GDoeB1Jg0J2FllFmxg7CjJg7CyYOoo4O2e0rB2
ijJKOTqUWbxmVKsdDpJoVgUdDoTBwUbFG5KPQaixsblhsblmxkeeA1KDQo1ksqjYjJNjg1GCjvLE
sKCaztP+F5GpQaEnUs/mUYE7CLKPM/I8TgaH/jx6CiYFSG4ljBRZQ9B+pkYJKKJ3llkfvMFmhqLE
8jsPM+Bk+o2O8wSZPhJ8flKl3HuOyPsPRLkStzkUUKEafbKle48hqSPE6GDcxI3JJgdS5IqVWChY
oMDUooaFGkhJRRR4CwmTuMBKHUoo0NTUs3KNjc3MHym5ZsSjY+BRtN/OVLvoTBtJsYPmPYZO0+M1
O4yLKiNSy51xKlWkJNiKUVEgUREj7qERP8nU6DAad0kcFFSqidw8p8+ZUu9RJ9ZQoojk5nbJVdCe
kkyaSJHVJUCygkHznPPZJcq5MkT/pt+J7z8DT3mn5H5l/b/e72H3nifmMCUMFl2VIlkljk3MRkqT
skJUiVWCj9cmpsYkjJoZLHQoWZJsWTYyTcWYGCSyRZ2z32JgoihkiyzQnBwaEjIaHJyIybz9NDY1
NCbHBuHQyNhU0/WTvsUSiu+UWNy5MaFRzLGhMFiyyiizYozD5JkwKKGkn32MmZ2bGRkYKNCyxZZZ
ZZZLnyYJgsssWSy/dI9MZkzO/ImSyiyUSVEaH0naMyR1E6CijwOo8DU7iYkkqSfEXsbHgSNKNRod
88NTcyOBg2JgWODcUWZ3k0M5lSoancTB0MDboclG5GplE3os1NjYYNjBk5iipubmowKJZzvKKqUW
NTkmDQ3LMjcyTkNamxkooUZOCixwRublFDBks0FCzBE2JMnBocnhxOTBqWbijgUYGBgaRMyhKITY
yZJRuNpWBkzKKonpkwYEwc5qQ7J93Q5OSjg4MGDAoZGRgmCLKJOBgYCUUVKFRLOTUwZMnEk9dSvR
DuNBcSQT5vIo+j2j2j1DMnzHzyNZK12GTAyTI0k0GgJpJGhURUifYWTA9xmSfXRufSYn7jWNNCOp
9mTg0NDQnYdh2G854k4qpwfyN9u2XKubTEg6yiciV7fCdDoeoztU2ODbE9h7TiRxUGxzOoKAklE2
xw7JdwUYFTYJJwogoCG0im0mBKTGCiYNjhAggiaTBKsBibTAj92g/xdyRThQkFzJrD4=
To recreate the original pcx file on disk, run the following command `base64 -d | bzip2 -d > in.pcx` then paste the base64 text blob, then hit CTRL-D twice. (By the way, don't use the "SELECT ALL" link that this bulletin board webpage put on my post. That link causes bogus space characters to be inserted that will screw up the decoding. Just copy/paste it manually.)
Last edited by Dondon on 2014-03-28T12:03:08-07:00, edited 1 time in total.
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

Re: convert from pcx to pcx turns every pixel to black

Post by Dondon »

Note that this can be verified merely be running `identify -verbose in.pcx out.pcx` and looking at the "Histogram:" lines. The latter one will have only black. It can also be seen in an image viewer, which will show an all black image as well.
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

Re: convert from pcx to pcx turns every pixel to black

Post by Dondon »

(I haven't tried every other conversion, but just now for that same file I tried converting to png and that appears to be accurate.) Also, this was using the yum binaries on "Fedora release 17 (Beefy Miracle)".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert from pcx to pcx turns every pixel to black

Post by snibgo »

PCX conversion seem to works for me, on IM v6.8.8-7 on Windows 8.1.

Your version is very old. Do you have problems with current versions? Please put a PCX file that shows the problem somewhere like dropbox.com and paste the URL here.
snibgo's IM pages: im.snibgo.com
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

Re: convert from pcx to pcx turns every pixel to black

Post by Dondon »

That version is the latest available on the OS. I didn't try compiling a custom one. See the original post for a PCX file that reproduces the problem.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert from pcx to pcx turns every pixel to black

Post by snibgo »

Sorry, I don't know how to turn "a base64 encoding of in.pcx.bz2" into in.pcx.
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: convert from pcx to pcx turns every pixel to black

Post by fmw42 »

convert in.pcx out.pcx
How did you run this, if you only have a base 64 encoding of in.pcx.bz2?

Surely you have in.pcx, if you were able to run the above command!
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

Re: convert from pcx to pcx turns every pixel to black

Post by Dondon »

Sorry, I accidentally assumed a certain type of unix command knowledge there. To recreate the original pcx file on disk, run the following command `base64 -d | bzip2 -d > in.pcx` then paste the base64 text blob, then hit CTRL-D twice. (By the way, don't use the "Select all" link that this bulletin board webpage put on my post. That link causes bogus space characters to be inserted that will screw up the decoding. Just copy/paste it manually.)

(I just edited the original post to mention those instructions.)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert from pcx to pcx turns every pixel to black

Post by snibgo »

Thanks. If I ran unix I could probably follow your instructions.
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: convert from pcx to pcx turns every pixel to black

Post by fmw42 »

To recreate the original pcx file on disk, run the following command `base64 -d | bzip2 -d > in.pcx` then paste the base64 text blob, then hit CTRL-D twice.
Why don't you follow those instructions and prepare an example pcx image and upload to dropbox.com (public folder) so that others can then download your image and test it.

Perhaps I am confused, but, with respect, how can you complain about a bug in Imagemagick, if you have not run the previously mentioned command, because you only have the base 64 encoded version. If you have run it, then you must have the image in.pcx that you can upload somewhere and post a link to it here.

The best way for us to verify a bug is to run the exact IM command that fails for you. We need to be sure that the problem is with IM and not with your base 64 data that may not be properly formed or converted to .pcx image format.
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

Re: convert from pcx to pcx turns every pixel to black

Post by Dondon »

I did run the original command. The whole point of the base64 thing was just to workaround the fact that this bug-hosting bulletin board website doesn't allow for file uploads. I have no convenient place to freely host it, so I just attached it as a base64 file. Any platform that can run ImageMagick can also run the base64 decode command.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert from pcx to pcx turns every pixel to black

Post by snibgo »

I don't have a base64 command.

If you provide the PCX, I can test it on various version of IM to see if it processes properly.

If, instead, you provide the PCX after processing through two filters, and I attempt the opposite, and IM doesn't process the result properly, we are not much further forward.
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: convert from pcx to pcx turns every pixel to black

Post by fmw42 »

The usual way to provide a proper image for this forum is to upload it to a free image hosting service such as dropbox.com (public folder) and then put a link here to your upload. Then we can download the .pcx file and test with it.
Dondon
Posts: 8
Joined: 2014-03-27T12:21:18-07:00
Authentication code: 6789

Re: convert from pcx to pcx turns every pixel to black

Post by Dondon »

The bug still occurs on "ImageMagick 6.8.6-3 2013-08-02 Q16" - behavior appears identical.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: convert from pcx to pcx turns every pixel to black

Post by dlemstra »

I can reproduce the error in IM 6.8.8-10. I will look into it.

Edit: A patch has been committed and this will be fixed in ImageMagick 6.9.0-0.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply