mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-26 11:38:01 +02:00
Rename processing steps: importColorProfile -> colorspaceToProcessing, exportColorProfile -> colorspaceToResult
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/imgproxy/imgproxy/v3/vips"
|
||||
)
|
||||
|
||||
func importColorProfile(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error {
|
||||
func colorspaceToProcessing(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error {
|
||||
if img.ColourProfileImported() {
|
||||
return nil
|
||||
}
|
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/imgproxy/imgproxy/v3/vips"
|
||||
)
|
||||
|
||||
func exportColorProfile(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error {
|
||||
func colorspaceToResult(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error {
|
||||
keepProfile := !po.StripColorProfile && po.Format.SupportsColourProfile()
|
||||
|
||||
if img.IsLinear() {
|
@@ -22,7 +22,7 @@ var mainPipeline = pipeline{
|
||||
trim,
|
||||
prepare,
|
||||
scaleOnLoad,
|
||||
importColorProfile,
|
||||
colorspaceToProcessing,
|
||||
crop,
|
||||
scale,
|
||||
rotateAndFlip,
|
||||
@@ -37,7 +37,7 @@ var mainPipeline = pipeline{
|
||||
}
|
||||
|
||||
var finalizePipeline = pipeline{
|
||||
exportColorProfile,
|
||||
colorspaceToResult,
|
||||
stripMetadata,
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ func trim(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions,
|
||||
}
|
||||
|
||||
// We need to import color profile before trim
|
||||
if err := importColorProfile(pctx, img, po, imgdata); err != nil {
|
||||
if err := colorspaceToProcessing(pctx, img, po, imgdata); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import (
|
||||
var watermarkPipeline = pipeline{
|
||||
prepare,
|
||||
scaleOnLoad,
|
||||
importColorProfile,
|
||||
colorspaceToProcessing,
|
||||
scale,
|
||||
rotateAndFlip,
|
||||
padding,
|
||||
|
@@ -407,6 +407,7 @@ vips_icc_is_srgb_iec61966(VipsImage *in)
|
||||
/* Predict it is sRGB IEC61966 2.1 by checking some header fields
|
||||
*/
|
||||
return ((memcmp(data + 48, "IEC ", 4) == 0) && // Device manufacturer
|
||||
(memcmp(data + 16, "RGB ", 4) == 0) && // Colorspace
|
||||
(memcmp(data + 52, "sRGB", 4) == 0) && // Device model
|
||||
(memcmp(data + 80, "HP ", 4) == 0) && // Profile creator
|
||||
(memcmp(data + 24, date, 6) == 0) && // Date of creation
|
||||
|
Reference in New Issue
Block a user