How to rotate pdf and undo rotating? Gives unexpected results.
Re: How to rotate pdf and undo rotating? Gives unexpected results.
Crosses.pdf includes a profile that is incompatible with the PDF output type. The input is sRGB and the output is gray alpha. You have two choices, strip the profile or force sRGB output with +profile sRGB or -type sRGB. Place either just before the output image filename on the command-line. Why does ImageMagick not do that automatically? Because the "user is king." ImageMagick assumes the user knows what they are doing and just follows the user instructions as defined by the command-line arguments.
Re: How to rotate pdf and undo rotating? Gives unexpected results.
Like this?
It's still producing the same results.
Code: Select all
convert -verbose -density 288 -colorspace sRGB crosses.pdf -alpha remove +profile sRGB out-2-x.pdf
convert -verbose -density 288 -colorspace sRGB out-2-x.pdf -alpha remove +profile sRGB out-2-x-2nd-save.pdf
It's still producing the same results.
Re: How to rotate pdf and undo rotating? Gives unexpected results.
I tried both, but neither works.magick wrote: ↑2018-09-15T07:30:09-07:00 Crosses.pdf includes a profile that is incompatible with the PDF output type. The input is sRGB and the output is gray alpha. You have two choices, strip the profile or force sRGB output with +profile sRGB or -type sRGB. Place either just before the output image filename on the command-line. Why does ImageMagick not do that automatically? Because the "user is king." ImageMagick assumes the user knows what they are doing and just follows the user instructions as defined by the command-line arguments.
Code: Select all
convert -verbose -density 288 -colorspace sRGB crosses.pdf -alpha remove -type sRGB out-2-x.pdf
convert -verbose -density 288 -colorspace sRGB out-2-x.pdf -alpha remove -type sRGB out-2-x-2nd-save.pdf
Code: Select all
convert.exe: unrecognized image type `sRGB' @ error/convert.c/ConvertImageCommand/3085.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to rotate pdf and undo rotating? Gives unexpected results.
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
Re: How to rotate pdf and undo rotating? Gives unexpected results.
GS 9.24 and Version: ImageMagick 6.9.10-11 Q16 x64 2018-08-29 Windows 8.1
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to rotate pdf and undo rotating? Gives unexpected results.
This fails for me on IM 6.9.10.11 Q16 Mac OSX Sierra. The png files are wrong.
But adding -strip works fine for me
This also works by adding +profile "*"
Code: Select all
convert crosses.pdf tmp.pdf
convert tmp.pdf tmp.png
But adding -strip works fine for me
Code: Select all
convert crosses.pdf -strip tmp.pdf
convert tmp.pdf tmp.png
This also works by adding +profile "*"
Code: Select all
convert crosses.pdf +profile "*" tmp.pdf
convert tmp.pdf tmp.png
Re: How to rotate pdf and undo rotating? Gives unexpected results.
That does produce the expected result. I noticed the 2nd save gets a little lighter, bigger in size.
Also, it seems I can't undo the damage of outputting a previously saved pdf without this profile or strip command.
Code: Select all
# increase in size
convert -verbose -density 288 -colorspace sRGB crosses.pdf -alpha remove +profile '*' out-2-x.pdf
# lighter increase in size
convert -verbose -density 288 -colorspace sRGB out-2-x.pdf -alpha remove +profile '*' out-2-x-2nd-save.pdf
# same as above
convert -verbose -density 288 -colorspace sRGB out-2-x-2nd-save.pdf -alpha remove +profile '*' out-2-x-3nd-save.pdf
Also, it seems I can't undo the damage of outputting a previously saved pdf without this profile or strip command.
Code: Select all
convert -verbose -density 288 -colorspace sRGB crosses.pdf -alpha remove out-2-x.pdf
convert -verbose -density 288 -colorspace sRGB out-2-x.pdf -alpha remove +profile '*' out-2-x-2nd-save.pdf
convert -verbose -density 288 -colorspace sRGB out-2-x.pdf -alpha remove -strip out-2-x-3rd-save.pdf
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to rotate pdf and undo rotating? Gives unexpected results.
The -strip removes more meta data than the +profile. So it could produce differences.
Re: How to rotate pdf and undo rotating? Gives unexpected results.
Neither +profile nor -strip can fix the output that doesn't use either.
Re: How to rotate pdf and undo rotating? Gives unexpected results.
thanks fmw42 for your help.