Can't open in Android JPEG or JPG images converted from PDF

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".

Can't open in Android JPEG or JPG images converted from PDF

Postby Johnny Well » 2013-01-30T07:41:32+00:00

Hello Everybody, i'm trying to convert some PDF into JPG files and use this files on android, but they just don't open in this system.

I was using Wand for python, but i tryed directly on shell just doing convert file.pdf file.jpg and this don't worked too

Someone can help me with this?
Johnny Well
 
Posts: 4
Joined: 2013-01-30T07:34:57+00:00

Re: Can't open in Android JPEG or JPG images converted from

Postby fmw42 » 2013-01-30T10:38:19+00:00

Perhaps your pdf is defined for cmyk. Some systems cannot handle cmyk jpgs. Try to convert your pdf to rgb first

convert -colorspace sRGB input.pdf output.jpg

Or just check the IM verbose info on your pdf and see if it is cmyk first.
User avatar
fmw42
 
Posts: 14945
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: Can't open in Android JPEG or JPG images converted from

Postby Johnny Well » 2013-01-30T12:58:18+00:00

fmw42 wrote:Perhaps your pdf is defined for cmyk. Some systems cannot handle cmyk jpgs. Try to convert your pdf to rgb first

convert -colorspace sRGB input.pdf output.jpg

Or just check the IM verbose info on your pdf and see if it is cmyk first.


Doing this way works fine, thanks.

But have one more detail, i'm using wand for python and to do this i need set the image.type atribute, for RGB this is "truecolor" but if i change this atribute the image become whitish.
Johnny Well
 
Posts: 4
Joined: 2013-01-30T07:34:57+00:00

Re: Can't open in Android JPEG or JPG images converted from

Postby fmw42 » 2013-01-30T13:22:57+00:00

But have one more detail, i'm using wand for python and to do this i need set the image.type atribute, for RGB this is "truecolor" but if i change this atribute the image become whitish.


I am not that familiar with any of the IM APIs. But I doubt that the type attribute is what you want to use. It is related to the colorspace not type.
User avatar
fmw42
 
Posts: 14945
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: Can't open in Android JPEG or JPG images converted from

Postby Johnny Well » 2013-01-31T04:17:18+00:00

Hong Minhee, the guy who makes the Wand bind told me that colorspace reflects in type attribute.

I'm working with images for the first time and i haven't experience with this, then i can't say what i think is correct.

Have some aspect what changes just this whitish in image?

If i convert the PDF to PNG directly from shell the whitish happens too.
Johnny Well
 
Posts: 4
Joined: 2013-01-30T07:34:57+00:00

Re: Can't open in Android JPEG or JPG images converted from

Postby fmw42 » 2013-01-31T10:23:03+00:00

Post a link to an example pdf that does not work correctly. Also identify your exact command and your version of IM and platform.
User avatar
fmw42
 
Posts: 14945
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: Can't open in Android JPEG or JPG images converted from

Postby Johnny Well » 2013-02-04T06:24:16+00:00

PDF --> http://dl.dropbox.com/u/86138930/stock.pdf

Whitish JPG --> http://dl.dropbox.com/u/86138930/stock.jpg (this is from wand)

Normal JPG --> http://dl.dropbox.com/u/86138930/stock_rgb.jpg (this is from shell)

When i convert from shell with "convert stock.pdf -colrspace RGB stock.jpg" thats work fine.
But in Wand (http://pypi.python.org/pypi/Wand) i have to do like this http://docs.wand-py.org/en/latest/guide/colorspace.html
but the resultant image isn't the same.

Both images are the truecolor type in wand, but one is normal and other whitish.
Johnny Well
 
Posts: 4
Joined: 2013-01-30T07:34:57+00:00

Re: Can't open in Android JPEG or JPG images converted from

Postby snibgo » 2013-02-04T07:48:26+00:00

Your shell command "convert stock.pdf -colorspace RGB stock.jpg" converts the image to the colorspace RGB, instead of the usual sRGB. Then it stores the image with a flag that says it is sRGB.

You need to find the equivalent wand-python commands that do this. I know nothing about wand-python.
snibgo's IM pages: im.snibgo.com
snibgo
 
Posts: 3878
Joined: 2010-01-23T23:01:33+00:00


Return to Users

Who is online

Users browsing this forum: Google [Bot] and 21 guests