Remove flip

This commit is contained in:
Milan Nikolic
2023-09-02 10:02:08 +02:00
parent 83d7a1ea6e
commit 6936f697b4
3 changed files with 2 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ It can convert comics to different formats to fit your various devices.
* reads CBR (RAR), CBZ (ZIP), CB7 (7Z), CBT (TAR), PDF, EPUB, MOBI and plain directory * reads CBR (RAR), CBZ (ZIP), CB7 (7Z), CBT (TAR), PDF, EPUB, MOBI and plain directory
* saves processed comics in ZIP archive format or TAR * saves processed comics in ZIP archive format or TAR
* images can be converted to JPEG, PNG, TIFF, WEBP, AVIF, or 4-Bit BMP (16 colors) file format * images can be converted to JPEG, PNG, TIFF, WEBP, AVIF, or 4-Bit BMP (16 colors) file format
* rotate, flip, adjust brightness/contrast, adjust levels (Photoshop-like) or grayscale images * rotate, adjust brightness/contrast, adjust levels (Photoshop-like) or grayscale images
* resize filters (NearestNeighbor, Box, Linear, MitchellNetravali, CatmullRom, Gaussian, Lanczos) * resize filters (NearestNeighbor, Box, Linear, MitchellNetravali, CatmullRom, Gaussian, Lanczos)
* export covers from comics * export covers from comics
* create thumbnails from covers by [FreeDesktop](http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html) specification * create thumbnails from covers by [FreeDesktop](http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html) specification
@@ -79,8 +79,6 @@ This is what it looks like in the PCManFM file manager:
            Convert images to grayscale (monochromatic) (default "false")             Convert images to grayscale (monochromatic) (default "false")
        --rotate         --rotate
            Rotate images, valid values are 0, 90, 180, 270 (default "0")             Rotate images, valid values are 0, 90, 180, 270 (default "0")
        --flip
            Flip images, valid values are none, horizontal, vertical (default "none")
        --brightness         --brightness
            Adjust the brightness of the images, must be in the range (-100, 100) (default "0")             Adjust the brightness of the images, must be in the range (-100, 100) (default "0")
        --contrast         --contrast

View File

@@ -120,8 +120,6 @@ type Options struct {
Grayscale bool Grayscale bool
// Rotate images, valid values are 0, 90, 180, 270 // Rotate images, valid values are 0, 90, 180, 270
Rotate int Rotate int
// Flip images, valid values are none, horizontal, vertical
Flip string
// Adjust the brightness of the images, must be in the range (-100, 100) // Adjust the brightness of the images, must be in the range (-100, 100)
Brightness int Brightness int
// Adjust the contrast of the images, must be in the range (-100, 100) // Adjust the contrast of the images, must be in the range (-100, 100)
@@ -496,7 +494,7 @@ func (c *Convertor) imageConvert(ctx context.Context, img image.Image, index int
return nil return nil
} }
// imageTransform transforms image (resize, rotate, flip, brightness, contrast). // imageTransform transforms image (resize, rotate, brightness, contrast).
func (c *Convertor) imageTransform(img image.Image) image.Image { func (c *Convertor) imageTransform(img image.Image) image.Image {
var i = img var i = img
@@ -519,15 +517,6 @@ func (c *Convertor) imageTransform(img image.Image) image.Image {
} }
} }
if c.Opts.Flip != "none" {
switch c.Opts.Flip {
case "horizontal":
i = imaging.FlipH(i)
case "vertical":
i = imaging.FlipV(i)
}
}
if c.Opts.Brightness != 0 { if c.Opts.Brightness != 0 {
i = imaging.AdjustBrightness(i, float64(c.Opts.Brightness)) i = imaging.AdjustBrightness(i, float64(c.Opts.Brightness))
} }

View File

@@ -180,7 +180,6 @@ func parseFlags() (cbconvert.Options, []string) {
convert.BoolVar(&opts.NoConvert, "no-convert", false, "Do not transform or convert images") convert.BoolVar(&opts.NoConvert, "no-convert", false, "Do not transform or convert images")
convert.BoolVar(&opts.Grayscale, "grayscale", false, "Convert images to grayscale (monochromatic)") convert.BoolVar(&opts.Grayscale, "grayscale", false, "Convert images to grayscale (monochromatic)")
convert.IntVar(&opts.Rotate, "rotate", 0, "Rotate images, valid values are 0, 90, 180, 270") convert.IntVar(&opts.Rotate, "rotate", 0, "Rotate images, valid values are 0, 90, 180, 270")
convert.StringVar(&opts.Flip, "flip", "none", "Flip images, valid values are none, horizontal, vertical")
convert.IntVar(&opts.Brightness, "brightness", 0, "Adjust the brightness of the images, must be in the range (-100, 100)") convert.IntVar(&opts.Brightness, "brightness", 0, "Adjust the brightness of the images, must be in the range (-100, 100)")
convert.IntVar(&opts.Contrast, "contrast", 0, "Adjust the contrast of the images, must be in the range (-100, 100)") convert.IntVar(&opts.Contrast, "contrast", 0, "Adjust the contrast of the images, must be in the range (-100, 100)")
convert.StringVar(&opts.Suffix, "suffix", "", "Add suffix to file basename") convert.StringVar(&opts.Suffix, "suffix", "", "Add suffix to file basename")