Problem with -resize JPGs

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?".
Post Reply
kleinstadtmc

Problem with -resize JPGs

Post by kleinstadtmc »

i have IM 6.3.5 - and i try to resize jpgs over php with the exec() function
and a lot things works with IM - but i have problems with the -resize at some jpgs

if i put a jpg from istockphoto on my webspace and try to resize it with IM - it dont works

but if i take the jpg and open it in my photoshop and save it with the "save for web" modul
and put it on my webspace - now resize works with IM... and it doesnt matter if i save it in photoshop with a large or small file/pic size

but if i try the same with the standard save as jpg function in photoshop - it doesnt work with IM - and it doesnt matter if i save it with a large or small file/pic size

somebody know what the problem is?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with -resize JPGs

Post by anthony »

See you other thread.
It is probably your viewer, or the images 'density'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
kleinstadtmc

Re: Problem with -resize JPGs

Post by kleinstadtmc »

ok - it seemed to be a problem with the resolution

because the original photo has 300dpi
the photos wich i save with the "save for web" function has 72dpi

now i try this code with the 300dpi photo:

Code: Select all

$convert = '/usr/bin/php-smed/convert photo.jpg -resize 248x350 -density 72x72 -units PixelsPerInch final.jpg';
exec($convert);
but i get no final.jpg

if i do it in two steps it works;

Code: Select all

echo $convert = '/usr/bin/php-smed/convert photo.jpg -density 72x72 -units PixelsPerInch photo72dpi.jpg';
exec($convert);
#echo $convert = '/usr/bin/php-smed/convert -size 248x350 xc:red \ photo72dpi.jpg -resize 248x350 -geometry +10+10 -composite final.jpg';
#exec($convert);
so did i something wrong in the first code with the syntax?
kleinstadtmc

Re: Problem with -resize JPGs

Post by kleinstadtmc »

now i tried it with different pics with diferent dpi with this code

Code: Select all

usr/bin/php-smed/convert photo.jpg -density 72x72 -units PixelsPerInch final.jpg
with 72dpi and 300dpi photos i have no problem
but if the photo has 120dpi i get no final.jpg

i don´t understand why is it like that...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with -resize JPGs

Post by anthony »

You are the second person to have this problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
kleinstadtmc

Re: Problem with -resize JPGs

Post by kleinstadtmc »

could this be a problem with the unix version or what?
or a configuration problem? what can i do?
kleinstadtmc

Re: Problem with -resize JPGs

Post by kleinstadtmc »

know i know one thing more - the image which is not works is a cmyk image not a rgb

so i try this code

Code: Select all

echo $convert = '/usr/bin/php-smed/convert photo.jpg -density 72x72 -units PixelsPerInch -colorspace RGB final.jpg';
exec($convert,$result);
but once again i get no final.jpg

maybe somebody has now a idea or knows a solution for this cmyk/rgb thing...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with -resize JPGs

Post by anthony »

In that case report a bug in the bugs forum with a link to the JPEG that does not work.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply