Welcome our webmaster and SEO forum
Please enjoy the forum, contribute what you can, and wind up the Moderators!
Results 1 to 4 of 4

Thread: need help with imagemagick

  1. #1
    dman_2007 Guest

    Default need help with imagemagick

    I am using convert command with -resize option to resize uploaded images into small png images. The problem is that if anyone uploads an animated gif file, then the convert command outputs more then one png file (exact number depends on the number of frames in the animated gif file). Anyone knows how i can get it to output only one file? Preferably the first frame of the animated gif file resized according to the geometry specified on the command line.

  2. #2
    dman_2007 Guest

    Default

    Ok, found out how to do it.

    convert inputfile[0] -resize 240x60 outputfile
    works with image formats other than gif as well. The number in square bracket ( 0 in the command given above) is the frame number in the animated file. Frames are numbered starting from 0.
    Last edited by dman_2007; 04-12-2008 at 12:49 PM.

  3. #3
    smeagain is offline Distinguished Member
    Join Date
    Jan 2008
    Posts
    263

    Default

    dman, does that resize using your code maintain "Aspect Ratio" or does it always (as in your quoted case( resize to a 4:1 width to height ration??

  4. #4
    dman_2007 Guest

    Default

    Aspect ratio is maintained, the geometry specified in the command specifies the maximum height and width. If you want to resize the image to that exact geometry without maintaining aspect ratio then append ! tio the geometry. For example,

    convert inputfile[0] -resize 240x60! outputfile

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124