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?
Can't open in Android JPEG or JPG images converted from PDF
-
- Posts: 4
- Joined: 2013-01-30T07:34:57-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Can't open in Android JPEG or JPG images converted from
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.
convert -colorspace sRGB input.pdf output.jpg
Or just check the IM verbose info on your pdf and see if it is cmyk first.
-
- Posts: 4
- Joined: 2013-01-30T07:34:57-07:00
- Authentication code: 6789
Re: Can't open in Android JPEG or JPG images converted from
Doing this way works fine, thanks.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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Can't open in Android JPEG or JPG images converted from
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.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.
-
- Posts: 4
- Joined: 2013-01-30T07:34:57-07:00
- Authentication code: 6789
Re: Can't open in Android JPEG or JPG images converted from
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Can't open in Android JPEG or JPG images converted from
Post a link to an example pdf that does not work correctly. Also identify your exact command and your version of IM and platform.
-
- Posts: 4
- Joined: 2013-01-30T07:34:57-07:00
- Authentication code: 6789
Re: Can't open in Android JPEG or JPG images converted from
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.
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.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Can't open in Android JPEG or JPG images converted from
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.
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