mirror of
				https://github.com/imgproxy/imgproxy.git
				synced 2025-10-30 23:08:02 +02:00 
			
		
		
		
	Fix lint issues
This commit is contained in:
		
							
								
								
									
										6
									
								
								heic.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								heic.go
									
									
									
									
									
								
							| @@ -52,13 +52,13 @@ func heifReadFtyp(r io.Reader, boxDataSize int64) error { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if bytes.Compare(data[0:4], heicBrand) == 0 { | ||||
| 	if bytes.Equal(data[0:4], heicBrand) { | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	if boxDataSize >= 12 { | ||||
| 		for i := int64(8); i < boxDataSize; i += 4 { | ||||
| 			if bytes.Compare(data[i:i+4], heicBrand) == 0 { | ||||
| 			if bytes.Equal(data[i:i+4], heicBrand) { | ||||
| 				return nil | ||||
| 			} | ||||
| 		} | ||||
| @@ -95,7 +95,7 @@ func heifReadHldr(r io.Reader, boxDataSize int64) error { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	if bytes.Compare(data[8:12], heicPict) != 0 { | ||||
| 	if !bytes.Equal(data[8:12], heicPict) { | ||||
| 		return fmt.Errorf("Invalid handler. Expected: pict, actual: %s", data[8:12]) | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -7,9 +7,9 @@ package main | ||||
| import "C" | ||||
|  | ||||
| import ( | ||||
| 	"path/filepath" | ||||
| 	"fmt" | ||||
| 	"net/url" | ||||
| 	"path/filepath" | ||||
| 	"strings" | ||||
| ) | ||||
|  | ||||
| @@ -71,9 +71,9 @@ func (it imageType) String() string { | ||||
| func (it imageType) Mime() string { | ||||
| 	if mime, ok := mimes[it]; ok { | ||||
| 		return mime | ||||
| 	} else { | ||||
| 		return "application/octet-stream" | ||||
| 	} | ||||
|  | ||||
| 	return "application/octet-stream" | ||||
| } | ||||
|  | ||||
| func (it imageType) ContentDisposition(imageURL string) string { | ||||
|   | ||||
| @@ -481,14 +481,13 @@ func transformImage(ctx context.Context, img **C.VipsImage, data []byte, po *pro | ||||
|  | ||||
| func transformAnimated(ctx context.Context, img **C.VipsImage, data []byte, po *processingOptions, imgtype imageType) error { | ||||
| 	imgWidth := int((*img).Xsize) | ||||
| 	imgHeight := int((*img).Ysize) | ||||
|  | ||||
| 	frameHeight, err := vipsGetInt(*img, "page-height") | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	framesCount := minInt(imgHeight/frameHeight, conf.MaxGifFrames) | ||||
| 	framesCount := minInt(int((*img).Ysize)/frameHeight, conf.MaxGifFrames) | ||||
|  | ||||
| 	// Double check dimensions because animated image has many frames | ||||
| 	if err := checkDimensions(imgWidth, frameHeight*framesCount); err != nil { | ||||
| @@ -509,7 +508,6 @@ func transformAnimated(ctx context.Context, img **C.VipsImage, data []byte, po * | ||||
| 		} | ||||
|  | ||||
| 		imgWidth = int((*img).Xsize) | ||||
| 		imgHeight = int((*img).Ysize) | ||||
|  | ||||
| 		frameHeight, err = vipsGetInt(*img, "page-height") | ||||
| 		if err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user