hi how would i use the imagemagick command line code that i got from the user section in php
If i read the manual correctly this should keep the sizing within the aspect ratio right? height of 125px with a max width of 190px
convert large.jpg -auto-orient -thumbnail 190x125 tn_small.jpg
Thumbnailing with php code?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Thumbnailing with php code?
-thumbnail 190x125 will scale to 190 (assuming your image width>height)
-thumbnail 190x125^ will scale to 125 (assuming your image width>height)
on windows you need ^^ (as ^ is an escape character)
see http://www.imagemagick.org/script/comma ... php#resize (-thumbnail should follow the same scheme as -resize)
-thumbnail 190x125^ will scale to 125 (assuming your image width>height)
on windows you need ^^ (as ^ is an escape character)
see http://www.imagemagick.org/script/comma ... php#resize (-thumbnail should follow the same scheme as -resize)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Thumbnailing with php code?
can't help you there. hopefully someone else can or try your question on one of the IM PHP forums.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Thumbnailing with php code?
See Rubble Web for examples of using command line IM from PHP scripts.
http://www.rubblewebs.co.uk/imagemagick/
http://www.rubblewebs.co.uk/imagemagick/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Thumbnailing with php code?
Just back from holiday; did you get this sorted ?
Re: Thumbnailing with php code?
i tried this code with no luckBonzo wrote:Just back from holiday; did you get this sorted ?
exec("convert -thumbnail 190x125 -auto-orient -quality 75 -strip watermarked.jpg tn_small.jpg");
maxwidth 190 and maxheight 125
Re: Thumbnailing with php code?
Versions after 6. something need the image reading in first.
-thumbnail strips the image anyway so you do not need -strip
-auto-orient only works if the image has the option ?
So I would try:
What do you mean when you say its not working?
-thumbnail strips the image anyway so you do not need -strip
-auto-orient only works if the image has the option ?
So I would try:
Code: Select all
exec("convert watermarked.jpg -thumbnail 190x125 -quality 75 tn_small.jpg");
Re: Thumbnailing with php code?
i changed it to resize and move the quality after the main image and everything works nowBonzo wrote:Versions after 6. something need the image reading in first.
-thumbnail strips the image anyway so you do not need -strip
-auto-orient only works if the image has the option ?
So I would try:What do you mean when you say its not working?Code: Select all
exec("convert watermarked.jpg -thumbnail 190x125 -quality 75 tn_small.jpg");
Code: Select all
exec("convert watermarked.jpg -quality 75 -resize 190x125 tn_small.jpg");