mirror of
https://github.com/gen2brain/cbconvert
synced 2025-10-14 02:28:51 +02:00
Remove flip
This commit is contained in:
@@ -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
|
||||
* 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
|
||||
* 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)
|
||||
* export covers from comics
|
||||
* 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")
|
||||
--rotate
|
||||
Rotate images, valid values are 0, 90, 180, 270 (default "0")
|
||||
--flip
|
||||
Flip images, valid values are none, horizontal, vertical (default "none")
|
||||
--brightness
|
||||
Adjust the brightness of the images, must be in the range (-100, 100) (default "0")
|
||||
--contrast
|
||||
|
13
cbconvert.go
13
cbconvert.go
@@ -120,8 +120,6 @@ type Options struct {
|
||||
Grayscale bool
|
||||
// Rotate images, valid values are 0, 90, 180, 270
|
||||
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)
|
||||
Brightness int
|
||||
// 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
|
||||
}
|
||||
|
||||
// imageTransform transforms image (resize, rotate, flip, brightness, contrast).
|
||||
// imageTransform transforms image (resize, rotate, brightness, contrast).
|
||||
func (c *Convertor) imageTransform(img image.Image) image.Image {
|
||||
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 {
|
||||
i = imaging.AdjustBrightness(i, float64(c.Opts.Brightness))
|
||||
}
|
||||
|
@@ -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.Grayscale, "grayscale", false, "Convert images to grayscale (monochromatic)")
|
||||
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.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")
|
||||
|
Reference in New Issue
Block a user