mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #1996 (Trimming option in cbr conversion)
This commit is contained in:
parent
4df17ef032
commit
39452cf714
@ -143,6 +143,7 @@ class PageProcessor(list):
|
|||||||
MagickRotateImage(wand, pw, -90)
|
MagickRotateImage(wand, pw, -90)
|
||||||
|
|
||||||
# 25 percent fuzzy trim?
|
# 25 percent fuzzy trim?
|
||||||
|
if not self.opts.disable_trim:
|
||||||
MagickTrimImage(wand, 25*65535/100)
|
MagickTrimImage(wand, 25*65535/100)
|
||||||
MagickSetImagePage(wand, 0,0,0,0) #Clear page after trim, like a "+repage"
|
MagickSetImagePage(wand, 0,0,0,0) #Clear page after trim, like a "+repage"
|
||||||
# Do the Photoshop "Auto Levels" equivalent
|
# Do the Photoshop "Auto Levels" equivalent
|
||||||
@ -303,6 +304,9 @@ def config(defaults=None,output_format='lrf'):
|
|||||||
help=_('Maintain picture aspect ratio. Default is to fill the screen.'))
|
help=_('Maintain picture aspect ratio. Default is to fill the screen.'))
|
||||||
c.add_opt('dont_sharpen', ['-s', '--disable-sharpen'], default=False,
|
c.add_opt('dont_sharpen', ['-s', '--disable-sharpen'], default=False,
|
||||||
help=_('Disable sharpening.'))
|
help=_('Disable sharpening.'))
|
||||||
|
c.add_opt('disable_trim', ['--disable-trim'], default=False,
|
||||||
|
help=_('Disable trimming of comic pages. For some comics, '
|
||||||
|
'trimming might remove content as well as borders.'))
|
||||||
c.add_opt('landscape', ['-l', '--landscape'], default=False,
|
c.add_opt('landscape', ['-l', '--landscape'], default=False,
|
||||||
help=_("Don't split landscape images into two portrait images"))
|
help=_("Don't split landscape images into two portrait images"))
|
||||||
c.add_opt('wide', ['-w', '--wide-aspect'], default=False,
|
c.add_opt('wide', ['-w', '--wide-aspect'], default=False,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Dialog</class>
|
<class>Dialog</class>
|
||||||
<widget class="QDialog" name="Dialog">
|
<widget class="QDialog" name="Dialog">
|
||||||
@ -6,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>646</width>
|
<width>646</width>
|
||||||
<height>468</height>
|
<height>503</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -100,21 +101,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" >
|
<item row="9" column="0">
|
||||||
<widget class="QCheckBox" name="opt_landscape">
|
<widget class="QCheckBox" name="opt_landscape">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Landscape</string>
|
<string>&Landscape</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0" >
|
<item row="11" column="0">
|
||||||
<widget class="QCheckBox" name="opt_no_sort">
|
<widget class="QCheckBox" name="opt_no_sort">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Don't so&rt</string>
|
<string>Don't so&rt</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="1" >
|
<item row="13" column="1">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -124,27 +125,34 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0" >
|
<item row="10" column="0">
|
||||||
<widget class="QCheckBox" name="opt_right2left">
|
<widget class="QCheckBox" name="opt_right2left">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Right to left</string>
|
<string>&Right to left</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0" >
|
<item row="12" column="0">
|
||||||
<widget class="QCheckBox" name="opt_despeckle">
|
<widget class="QCheckBox" name="opt_despeckle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>De&speckle</string>
|
<string>De&speckle</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0" >
|
<item row="8" column="0">
|
||||||
<widget class="QCheckBox" name="opt_wide">
|
<widget class="QCheckBox" name="opt_wide">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Wide</string>
|
<string>&Wide</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QCheckBox" name="opt_disable_trim">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable &Trimming</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user