Free Trial
10 days, no credit_card

<< More Tutorials

How to resize an image by height in Python 2 using rethumb?

To resize an image or photo in Python 2 use the following code:

import urllib2

param_operation = "height"
param_value = 100 # New height in pixels.

image_url = ""
image_filename = "resized-image.jpg"

response = urllib2.urlopen("{0}/{1}/{2}".format(param_operation, param_value, image_url))
fh = open(image_filename, "w")

Start using this example now

Use the following commands to get started:

$ git clone
$ cd rethumb-python2-examples
$ python resize-by-height.js

More examples using Python 2