h2non / bimg

Go package for fast high-level image processing powered by libvips C library
https://pkg.go.dev/github.com/h2non/bimg?tab=doc
MIT License
2.66k stars 337 forks source link

vips_colourspace is called twice #167

Open jayme-github opened 7 years ago

jayme-github commented 7 years ago

Just saw with DEBUG=bimg" and VIPS_TRACE=1 that vips_colourspace() is called twice but I could not find any reference to the second call.

vips cache+: jpegload_buffer buffer=VIPS_TYPE_BLOB, data = 0xc4206d4000, length = 1268657 out=((VipsImage*) 0x7ffbd80a6020) flags=((VipsForeignFlags) VIPS_FOREIGN_SEQUENTIAL) access=((VipsAccess) VIPS_ACCESS_RANDOM) -
11:35:37.272 8s     8s     bimg - Options: bimg.Options{Height:220, Width:980, AreaHeight:0, AreaWidth:0, Top:0, Left:0, Quality:90, Compression:6, Zoom:0, Crop:true, SmartCrop:false, Enlarge:false, Embed:false, Flip:false, Flop:false, Force:false, NoAutoRotate:false, NoProfile:false, Interlace:false, Extend:0, Rotate:0, Background:bimg.Color{R:0x0, G:0x0, B:0x0}, Gravity:0, Watermark:bimg.Watermark{Width:0, DPI:0, Margin:0, Opacity:0, NoReplicate:false, Text:"", Font:"", Background:bimg.Color{R:0x0, G:0x0, B:0x0}}, WatermarkImage:bimg.WatermarkImage{Left:0, Top:0, Buf:[]uint8(nil), Opacity:0}, Type:1, Interpolator:0, Interpretation:22, GaussianBlur:bimg.GaussianBlur{Sigma:0, MinAmpl:0}, Sharpen:bimg.Sharpen{Radius:0, X1:0, Y2:0, Y3:0, M1:0, M2:0}}
vips cache+: jpegload_buffer buffer=VIPS_TYPE_BLOB, data = 0xc4206d4000, length = 1268657 out=((VipsImage*) 0x7ffbd80a61b0) flags=((VipsForeignFlags) VIPS_FOREIGN_SEQUENTIAL) shrink=2 -
vips cache : copy in=((VipsImage*) 0x7ffbd80a61b0) out=((VipsImage*) 0x7ffbd80a64d0) -
vips cache+: black out=((VipsImage*) 0x7ffbd80a6980) width=1 height=1 bands=3 -
vips cache : copy in=((VipsImage*) 0x7ffbd80a6980) out=((VipsImage*) 0x7ffbd80a6ca0) -
vips cache+: linear in=((VipsImage*) 0x7ffbd80a6980) out=((VipsImage*) 0x7ffbd80a6b10) a=1  b=0  -
vips cache : copy in=((VipsImage*) 0x7ffbd80a6b10) out=((VipsImage*) 0x7ffbd80d9010) -
vips cache+: cast in=((VipsImage*) 0x7ffbd80a6b10) out=((VipsImage*) 0x7ffbd80a6e30) format=((VipsBandFormat) VIPS_FORMAT_UCHAR) -
vips cache : copy in=((VipsImage*) 0x7ffbd80a6e30) out=((VipsImage*) 0x7ffbd80d91a0) -
vips cache+: embed in=((VipsImage*) 0x7ffbd80a64d0) out=((VipsImage*) 0x7ffbd80a6660) x=1 y=1 width=1364 height=309 extend=((VipsExtend) VIPS_EXTEND_COPY) -
vips cache+: affine in=((VipsImage*) 0x7ffbd80a61b0) interpolate=((VipsInterpolateBicubic*) 0x7ffbd80b9c50) out=((VipsImage*) 0x7ffbd80a6340) matrix=0.720323 0 0 0.720323  -
vips cache+: extract_area input=((VipsImage*) 0x7ffbd80a6340) out=((VipsImage*) 0x7ffbd80d94c0) left=0 top=0 width=980 height=220 -
11:35:37.273 1ms    1ms    bimg - Transform: shrink=1, residual=0.7203234105108416, interpolator=bicubic
vips cache+: colourspace in=((VipsImage*) 0x7ffbd80d94c0) out=((VipsImage*) 0x7ffbd80d9650) space=((VipsInterpretation) VIPS_INTERPRETATION_sRGB) -
vips cache+: colourspace in=((VipsImage*) 0x7ffbd80d9650) out=((VipsImage*) 0x7ffbd80d97e0) space=((VipsInterpretation) VIPS_INTERPRETATION_sRGB) -
vips cache+: cast in=((VipsImage*) 0x7ffbd80d97e0) out=((VipsImage*) 0x7ffbd80a67f0) format=((VipsBandFormat) VIPS_FORMAT_UCHAR) -
vips cache+: linecache in=((VipsImage*) 0x7ffbd80d9b00) out=((VipsImage*) 0x7ffbd80d9e20) tile-height=8 access=((VipsAccess) VIPS_ACCESS_SEQUENTIAL_UNBUFFERED) -
vips cache+: sequential in=((VipsImage*) 0x7ffbd80d9b00) out=((VipsImage*) 0x7ffbd80d9c90) tile-height=8 access=((VipsAccess) VIPS_ACCESS_SEQUENTIAL_UNBUFFERED) -
vips cache : jpegsave_buffer in=((VipsImage*) 0x7ffbd80d9650) buffer=VIPS_TYPE_BLOB, data = 0x7ffbd8145b90, length = 62598 Q=90 optimize-coding=TRUE interlace=FALSE strip=TRUE -
h2non commented 7 years ago

It's possibly called internally by libvips. I didn't notice this in the past, but I don't think this is having any negative impact in the image processing.