GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — imgproxy/processing/export_color_profile.go at master · pushd/imgproxy Expand file tree/ Copy pathexport_color_profile.goMore file actions 45 lines (39 loc) · 1.15 KB / Copy pathexport_color_profile.goFile metadata and controls45 lines (39 loc) · 1.15 KB 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. |