소스 검색

Save HEIC to JPEG by default

DarthSim 5 년 전
부모
커밋
4a59e3d625
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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.
 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
 ## 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:
 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.Format == imageTypeUnknown {
 		if po.PreferWebP && vipsTypeSupportSave[imageTypeWEBP] {
 		if po.PreferWebP && vipsTypeSupportSave[imageTypeWEBP] {
 			po.Format = imageTypeWEBP
 			po.Format = imageTypeWEBP
-		} else if vipsTypeSupportSave[imgtype] {
+		} else if vipsTypeSupportSave[imgtype] && imgtype != imageTypeHEIC {
 			po.Format = imgtype
 			po.Format = imgtype
 		} else {
 		} else {
 			po.Format = imageTypeJPEG
 			po.Format = imageTypeJPEG