Skip to content

Commit

Permalink
Rename Stretch to ScaleCrop
Browse files Browse the repository at this point in the history
  • Loading branch information
axu2 committed Mar 25, 2021
1 parent c1e8a8c commit 38832b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mangle/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ImageFlags:
Resize = 1 << 1
Frame = 1 << 2
Quantize = 1 << 3
Stretch = 1 << 4
ScaleCrop = 1 << 4
SplitRightLeft = 1 << 5 # split right then left
SplitRight = 1 << 6 # split only the right page
SplitLeft = 1 << 7 # split only the left page
Expand Down Expand Up @@ -134,7 +134,7 @@ def quantizeImage(image, palette):


@protect_bad_image
def stretchImage(image, size):
def scaleCropImage(image, size):
return ImageOps.fit(image, size, Image.ANTIALIAS)


Expand Down Expand Up @@ -275,7 +275,7 @@ def convertImage(source, target, device, flags):
image = orientImage(image, size)
if flags & ImageFlags.Resize:
image = resizeImage(image, size)
if flags & ImageFlags.Stretch:
if flags & ImageFlags.ScaleCrop:
image = stretchImage(image, size)
if flags & ImageFlags.Frame:
image = frameImage(image, tuple(palette[:3]), tuple(palette[-3:]), size)
Expand Down
6 changes: 3 additions & 3 deletions mangle/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def moveOptionsToDialog(self):
self.checkboxOverwrite.setChecked(self.book.overwrite)
self.checkboxOrient.setChecked(self.book.imageFlags & ImageFlags.Orient)
self.checkboxResize.setChecked(self.book.imageFlags & ImageFlags.Resize)
self.checkboxStretch.setChecked(self.book.imageFlags & ImageFlags.Stretch)
self.checkboxScaleCrop.setChecked(self.book.imageFlags & ImageFlags.ScaleCrop)
self.checkboxQuantize.setChecked(self.book.imageFlags & ImageFlags.Quantize)
self.checkboxFrame.setChecked(self.book.imageFlags & ImageFlags.Frame)

Expand All @@ -62,8 +62,8 @@ def moveDialogToOptions(self):
imageFlags |= ImageFlags.Orient
if self.checkboxResize.isChecked():
imageFlags |= ImageFlags.Resize
if self.checkboxStretch.isChecked():
imageFlags |= ImageFlags.Stretch
if self.checkboxScaleCrop.isChecked():
imageFlags |= ImageFlags.ScaleCrop
if self.checkboxQuantize.isChecked():
imageFlags |= ImageFlags.Quantize
if self.checkboxFrame.isChecked():
Expand Down
2 changes: 1 addition & 1 deletion mangle/ui/options.ui
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
</widget>
</item>
<item>
<widget class="QRadioButton" name="checkboxStretch">
<widget class="QRadioButton" name="checkboxScaleCrop">
<property name="text">
<string>Scale and crop images to fill the screen</string>
</property>
Expand Down

0 comments on commit 38832b8

Please sign in to comment.