Page 1 of 1

Creating Thumbnails and resizing Images

Posted: 2008-10-31T11:30:15-07:00
by sim123
Can I create thumbnail and resize the image to a specific pixel size in one convert command?
I am doing something like this
convert -resize 200x200! -thumbnail 50x50! /Users/sim/2.jpeg /Users/sim/2_f.jpeg /Users/sim/2_t.jpeg

However I am not getting resized image (both images are thumbnails), so I am doing something wrong here. I want to create resized image and thumbnail form for the same image, just wondering what could be the most efficient way of doing this.

Thanks for all the help and support.

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T11:36:48-07:00
by fmw42
sim123 wrote:Can I create thumbnail and resize the image to a specific pixel size in one convert command?
I am doing something like this
convert -resize 200x200! -thumbnail 50x50! /Users/sim/2.jpeg /Users/sim/2_f.jpeg /Users/sim/2_t.jpeg

However I am not getting resized image (both images are thumbnails), so I am doing something wrong here. I want to create resized image and thumbnail form for the same image, just wondering what could be the most efficient way of doing this.

Thanks for all the help and support.
Yes, here is an example using the IM built-in image, logo: (replace logo: with your input image)

convert logo: -resize 50% -write logo_resize.jpg -thumbnail 100x100 logo_thumbnail.jpg


NOTE: correct v6 syntax is to put the input image right after convert and before your arguments/options

see:
http://www.imagemagick.org/Usage/basics/#cmdline

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T11:46:08-07:00
by sim123
Thanks for the reply, this command is working fine for logo, however I am getting an error with my image

convert: unable to open image `2.jpeg:': No such file or directory.
convert: missing an image filename `logo_thumbnail.jpg'.

here is the command I tried
convert 2.jpeg: -resize 50% -write logo_resize.jpg -thumbnail 100x100 logo_thumbnail.jpg

This file 2.jpeg does exist in my home directory

Thanks

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T11:48:46-07:00
by fmw42
sim123 wrote:Thanks for the reply, this command is working fine for logo, however I am getting an error with my image

convert: unable to open image `2.jpeg:': No such file or directory.
convert: missing an image filename `logo_thumbnail.jpg'.

here is the command I tried
convert 2.jpeg: -resize 50% -write logo_resize.jpg -thumbnail 100x100 logo_thumbnail.jpg

This file 2.jpeg does exist in my home directory

Thanks
Try renaming it to 2.jpg (perhaps IM does not recognize the suffix, .jpeg) or else you may need to have the jpg and jpeg2000 image delegates installed. Is your image a normal jpeg or jpeg2000 format? To see what delegates you have

convert -list configure

and look for the line DELEGATES. Mine says

DELEGATES bzlib fontconfig freetype gs jpeg jp2 lcms lqr openexr png tiff x11 xml zlib


You can get the delegate libraries at http://www.imagemagick.org/download/delegates/

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T12:55:01-07:00
by sim123
I do have jpeg library installed, here is my convert -list configure result.

DELEGATES bzlib freetype jpeg jp2 png tiff x11 xml zlib

I am using jpeg and its working fine in single operation but not in multi operations.

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T14:15:00-07:00
by fmw42
sim123 wrote:I do have jpeg library installed, here is my convert -list configure result.

DELEGATES bzlib freetype jpeg jp2 png tiff x11 xml zlib

I am using jpeg and its working fine in single operation but not in multi operations.
If the logo: image works, then I can think of no reason that your 2.jpeg should not work, unless there is something strange about that image. (For example was the jpeg created in Photoshop using Quicktime?) Can you provide a link to that image, so we can try it ourselves? If not do

identify -verbose 2.jpeg

and post the results.

Also what version of IM are you using. Look at the convert -list configure results at the line LIB_VERSION_NUMBER

Mine is LIB_VERSION_NUMBER 6,4,5,1


Are you on Windows, Linux or Mac?

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T14:50:56-07:00
by sim123
Thanks for the reply

I tried another image from internet
http://www.mapadvanceservices.com/siteb ... s/face.jpg

Here is the result

153x103:~ Simrit$ convert face.jpg: -resize 50% -write face_1_resize.jpg -thumbnail 100x100 face_1_thumbnail.jpg
convert: unable to open image `face.jpg:': No such file or directory.
convert: missing an image filename `face_1_thumbnail.jpg'.
153x103:~ Simrit$

I am on MAC OS X, and I have latest ImageMagick version installed
LIB_VERSION_NUMBER 6,4,5,0
LIBS -lMagickCore -ltiff -lfreetype -ljpeg -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lpthread

The strange thing is if I could do it separately, than everything works. I am not sure what is the problem? Am I giving something wrong in the command?

Thanks for the help.

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T15:09:00-07:00
by el_supremo
convert face.jpg: -resize 50% -write face_1_resize.jpg -thumbnail 100x100 face_1_thumbnail.jpg
Why do you have a colon after face.jpg?
Try this:

Code: Select all

convert face.jpg -resize 50% -write face_1_resize.jpg -thumbnail 100x100 face_1_thumbnail.jpg
Pete

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T15:40:35-07:00
by sim123
Thanks it worked, I put colon because logo example had colon after it :)

Thank you so much for the help and support, this forum is really helping and I get very quick response every time, thanks to all of you for this.

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T15:48:27-07:00
by fmw42
sim123 wrote:Thanks it worked, I put colon because logo example had colon after it :)

Thank you so much for the help and support, this forum is really helping and I get very quick response every time, thanks to all of you for this.
Sorry I missed the colon and did not explain that well ahead of time in my example. I thought you understood about that. (Thanks Pete for catching that)

Only the IM internal images, logo:, rose:, etc use the colon to end the image. All non-internal-IM images are referenced with their correct suffix.

see http://www.imagemagick.org/script/forma ... tin-images

Re: Creating Thumbnails and resizing Images

Posted: 2008-10-31T15:57:45-07:00
by sim123
Thanks for quick response(for all of my questions), I will keep that in mind for future.