GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — imgproxy/processing/export_color_profile.go at master · pushd/imgproxy

Expand file tree

/

export_color_profile.go

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
45 lines (39 loc) · 1.15 KB
/

export_color_profile.go

Copy path

File metadata and controls

45 lines (39 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package processing
import (
"github.com/imgproxy/imgproxy/v3/imagedata"
"github.com/imgproxy/imgproxy/v3/options"
"github.com/imgproxy/imgproxy/v3/vips"
)
func exportColorProfile(pctx *pipelineContext, img *vips.Image, po *options.ProcessingOptions, imgdata *imagedata.ImageData) error {
keepProfile := !po.StripColorProfile && po.Format.SupportsColourProfile()
if img.IsLinear() {
if err := img.RgbColourspace(); err != nil {
return err
}
}
if pctx.iccImported {
if keepProfile {
// We imported ICC profile and want to keep it,
// so we need to export it
if err := img.ExportColourProfile(); err != nil {
return err
}
} else {
// We imported ICC profile but don't want to keep it,
// so we need to export image to sRGB for maximum compatibility
if err := img.ExportColourProfileToSRGB(); err != nil {
return err
}
}
} else if !keepProfile {
// We don't import ICC profile and don't want to keep it,
// so we need to transform it to sRGB for maximum compatibility
if err := img.TransformColourProfile(); err != nil {
return err
}
}
if !keepProfile {
return img.RemoveColourProfile()
}
return nil
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.