|
51 | 51 | PngQuantize bool |
52 | 52 | PngQuantizationColors int |
53 | 53 | AvifSpeed int |
| 54 | + HeicTileWidth int |
| 55 | + HeicTileHeight int |
54 | 56 | Quality int |
55 | 57 | FormatQuality map[imagetype.Type]int |
56 | 58 | StripMetadata bool |
@@ -244,6 +246,8 @@ func Reset() { |
244 | 246 | PngQuantize = false |
245 | 247 | PngQuantizationColors = 256 |
246 | 248 | AvifSpeed = 9 |
| 249 | + HeicTileWidth = 0 |
| 250 | + HeicTileHeight = 0 |
247 | 251 | Quality = 80 |
248 | 252 | FormatQuality = map[imagetype.Type]int{imagetype.AVIF: 65} |
249 | 253 | StripMetadata = true |
@@ -436,6 +440,8 @@ func Configure() error { |
436 | 440 | configurators.Bool(&PngQuantize, "IMGPROXY_PNG_QUANTIZE") |
437 | 441 | configurators.Int(&PngQuantizationColors, "IMGPROXY_PNG_QUANTIZATION_COLORS") |
438 | 442 | configurators.Int(&AvifSpeed, "IMGPROXY_AVIF_SPEED") |
| 443 | + configurators.Int(&HeicTileWidth, "IMGPROXY_HEIC_TILE_WIDTH") |
| 444 | + configurators.Int(&HeicTileHeight, "IMGPROXY_HEIC_TILE_HEIGHT") |
439 | 445 | configurators.Int(&Quality, "IMGPROXY_QUALITY") |
440 | 446 | if err := configurators.ImageTypesQuality(FormatQuality, "IMGPROXY_FORMAT_QUALITY"); err != nil { |
441 | 447 | return err |
@@ -666,6 +672,13 @@ func Configure() error { |
666 | 672 | return fmt.Errorf("Avif speed can't be greater than 9, now - %d\n", AvifSpeed) |
667 | 673 | } |
668 | 674 |
|
| 675 | + if HeicTileWidth < 0 { |
| 676 | + return fmt.Errorf("HEIC tile width should be 0 (disabled) or a positive value, now - %d\n", HeicTileWidth) |
| 677 | + } |
| 678 | + if HeicTileHeight < 0 { |
| 679 | + return fmt.Errorf("HEIC tile height should be 0 (disabled) or a positive value, now - %d\n", HeicTileHeight) |
| 680 | + } |
| 681 | + |
669 | 682 | if Quality <= 0 { |
670 | 683 | return fmt.Errorf("Quality should be greater than 0, now - %d\n", Quality) |
671 | 684 | } else if Quality > 100 { |
|
0 commit comments