Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Fix TypeError in Py3k.
Browse files Browse the repository at this point in the history
  • Loading branch information
samdobson committed Jul 19, 2013
1 parent 6489ea0 commit 96f5834
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions image_slicer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,14 @@ def split_image(filename, num_tiles):
Split an image into a specified number of tiles.
Return a tuple of ``_ImageCrop`` instances.
"""
# try:
# Needs tests.
im = Image.open(filename)
# except:
# raise ValueError('Invalid image file: {0}'.format(filename))
validate_image(im, num_tiles)

im_w, im_h = im.size
columns, rows = calc_columns_rows(num_tiles)
extras = (columns * rows) - num_tiles
tile_w, tile_h = im_w / columns, im_h / rows

# print("""
# Image size: {0}
# No. tiles: {1}
# Columns: {2}
# Rows: {3}
# Tile size: {4}, {5}
# """.format(im.size, num_tiles, columns, rows, tile_w, tile_h))
tile_w, tile_h = int(im_w / columns), int(im_h / rows)

tiles = []
num = 1
Expand Down

0 comments on commit 96f5834

Please sign in to comment.