Browse Source

Save HEIC to JPEG by default

DarthSim 5 years ago
parent
commit
4a59e3d625
2 changed files with 7 additions and 1 deletions
  1. 6 0
      docs/image_formats_support.md
  2. 1 1
      process.go

+ 6 - 0
docs/image_formats_support.md

@@ -18,6 +18,12 @@ imgproxy supports GIF output only when using libvips 8.7.0+ compiled with ImageM
 
 imgproxy supports ICO output only when using libvips 8.7.0+ compiled with ImageMagick support. Official imgproxy Docker image supports ICO out of the box.
 
+## HEIC support
+
+imgproxy supports HEIC only when using libvips 8.8.0+. Official imgproxy Docker image supports HEIC out of the box.
+
+By default, imgproxy saves HEIC images as JPEG. You need to explicitly specify the `format` option to get HEIC output.
+
 ## Animated images support
 
 Since processing of animated images is pretty heavy, only one frame is processed by default. You can increase the maximum of animation frames to process with the following variable:

+ 1 - 1
process.go

@@ -499,7 +499,7 @@ func processImage(ctx context.Context) ([]byte, context.CancelFunc, error) {
 	if po.Format == imageTypeUnknown {
 		if po.PreferWebP && vipsTypeSupportSave[imageTypeWEBP] {
 			po.Format = imageTypeWEBP
-		} else if vipsTypeSupportSave[imgtype] {
+		} else if vipsTypeSupportSave[imgtype] && imgtype != imageTypeHEIC {
 			po.Format = imgtype
 		} else {
 			po.Format = imageTypeJPEG