Skip to content

Commit

Permalink
Merge 8797526 into 37aecf5
Browse files Browse the repository at this point in the history
  • Loading branch information
Mataniko committed Jul 24, 2018
2 parents 37aecf5 + 8797526 commit 5a7c448
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions glue/formats/img.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def populate_argument_parser(cls, parser):
default=os.environ.get('GLUE_RATIOS', '1'),
help="Create sprites based on these ratios")

group.add_argument("--scaling",
dest="scaling",
type=int,
default=1,
help="Change the scaling algorithm for ratios")

group.add_argument("--retina",
dest="ratios",
default=os.environ.get('GLUE_RETINA', False),
Expand Down Expand Up @@ -136,11 +142,11 @@ def save(self, ratio):

# If this canvas isn't the biggest one scale it using the ratio
if self.sprite.max_ratio != ratio:

reduced_canvas = canvas.resize(
(round_up((width / self.sprite.max_ratio) * ratio),
round_up((height / self.sprite.max_ratio) * ratio)),
PILImage.ANTIALIAS)
self.sprite.config['scaling'])
reduced_canvas.save(image_path, **kwargs)
# TODO: Use Imagemagick if it's available
else:
Expand Down

0 comments on commit 5a7c448

Please sign in to comment.