Find the answer to your Linux question:
Results 1 to 4 of 4
I wrote a script to help me resize a few hundred photos but ran into a little snag. I cant seem to figure out how to resize the photos to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2005
    Posts
    54

    Resizing Images with convert - Don't want to presere proportions


    I wrote a script to help me resize a few hundred photos but ran into a little snag. I cant seem to figure out how to resize the photos to a specifc geometry. I have a photo of whatever size and want it resized/stretched/skewed to be exactly 605x341. Problem is every option I have tried with the convert program keeps the proportions the same giving the photo a 580x341 geometry. I can do these one at a time in photoshop but that would be a pain in the ass.

    Anyone know any other command line utilities to resize images or the right command I need for convert??

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    What you want to do is add an ! on the end of the geometry using convert. This forces the geometry.

    So something like:

    Code:
    convert -geometry 605x341! input.jpg output.jpg
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    What you want to do is add an ! on the end of the geometry using convert. This forces the geometry.

    So something like:

    Code:
    convert -geometry 605x341! input.jpg output.jpg
    Note to Mods: Apologies for the dupe, please feel free to delete the 2nd post here, i made the post, and it came back to the reply screen, so posted again! :S
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  4. #4
    Just Joined!
    Join Date
    Dec 2005
    Posts
    54
    Thanks for the response.

    Maybe you could help me with another issue.. I have two images one is a image of 613x349(2.jpg) which is basically white with a small outline around it, the other is a picture at 605x341(1.jpg) I combined the two with:

    composite -compose In -gravity center 1.jpg 2.jpg new.jpg (better way perhaps?)

    This gave the desired results.. the picture put into the image with the border I created around it however when I view the image as thumbnail all I see is the number 2 image, not the combined result. If I open the image I see the combined result though. I cleared my thumbnail cache case that was the issue but still shows it that way.
    Any Idea why??

    Additional note: If I open the image in say gimp, then just save the image again it appears they way its suppose to. Gimp doesnt say that it is changing anything or converting it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •