davidbyttow / govips

A lightning fast image processing and resizing library for Go
MIT License
1.28k stars 199 forks source link

Resource images with timestamps in the name cause invalid file path errors #353

Closed AttilaTheFun closed 1 year ago

AttilaTheFun commented 1 year ago

I was just trying to update my govips dependency and when pulling in the current master commit with go get I received all of these invalid file path errors:

resources/png-24bit+alpha.ModulateHSV_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.ModulateHSV_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit+alpha.Modulate_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.Modulate_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit+alpha.Modulate_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.Modulate_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit+alpha.Sharpen_24bit_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.Sharpen_24bit_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit+alpha.Sharpen_24bit_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.Sharpen_24bit_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit+alpha.TestImageRef_Linear_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.TestImageRef_Linear_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit+alpha.TestImageRef_Linear_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit+alpha.TestImageRef_Linear_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.AutoRotate_0-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.AutoRotate_0-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.AutoRotate_0-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.AutoRotate_0-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.GetPointWhite-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.GetPointWhite-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.GetPointWhite-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.GetPointWhite-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.GetPointWhiteR-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.GetPointWhiteR-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.GetPointWhiteR-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.GetPointWhiteR-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.GetPointYellow-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.GetPointYellow-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.GetPointYellow-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.GetPointYellow-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.Rank-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.Rank-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.Rank-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.Rank-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.TestImageRef_Linear1-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.TestImageRef_Linear1-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.TestImageRef_Linear1-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.TestImageRef_Linear1-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.TestThumbnail_PNG_CropCentered-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-24bit.TestThumbnail_PNG_CropCentered-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-24bit.TestThumbnail_PNG_CropCentered-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-24bit.TestThumbnail_PNG_CropCentered-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.EmbedBackgroundRGBA_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.EmbedBackgroundRGBA_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.EmbedBackgroundRGBA_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.EmbedBackgroundRGBA_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.EmbedBackground_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.EmbedBackground_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.EmbedBackground_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.EmbedBackground_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Embed_ExtendWhite_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Embed_ExtendWhite_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Embed_ExtendWhite_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Embed_ExtendWhite_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Resize_Downscale_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Resize_Downscale_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Resize_Downscale_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Resize_Downscale_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Resize_Upscale_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Resize_Upscale_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Resize_Upscale_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Resize_Upscale_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Sharpen_8bit_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Sharpen_8bit_Alpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit+alpha.Sharpen_8bit_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit+alpha.Sharpen_8bit_Alpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-8bit.Decode_PNG-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-8bit.Decode_PNG-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-8bit.Decode_PNG-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-8bit.Decode_PNG-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/png-alpha-64bit.PNG_64bit_OptimizeICCProfile-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/png-alpha-64bit.PNG_64bit_OptimizeICCProfile-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/png-alpha-64bit.PNG_64bit_OptimizeICCProfile-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/png-alpha-64bit.PNG_64bit_OptimizeICCProfile-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/tif-16bit.TIF_16_Bit_To_AVIF_12_Bit-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.avif: malformed file path "resources/tif-16bit.TIF_16_Bit_To_AVIF_12_Bit-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.avif": invalid char ':'
resources/tif-16bit.TIF_16_Bit_To_AVIF_12_Bit-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.avif: malformed file path "resources/tif-16bit.TIF_16_Bit_To_AVIF_12_Bit-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.avif": invalid char ':'
resources/tif.Tiff-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.tiff: malformed file path "resources/tif.Tiff-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.tiff": invalid char ':'
resources/tif.Tiff-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.tiff: malformed file path "resources/tif.Tiff-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.tiff": invalid char ':'
resources/with_alpha.ExtractBand-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/with_alpha.ExtractBand-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.ExtractBand-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/with_alpha.ExtractBand-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.Flatten-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/with_alpha.Flatten-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.Flatten-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/with_alpha.Flatten-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.GetPoint_WithAlpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/with_alpha.GetPoint_WithAlpha-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.GetPoint_WithAlpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/with_alpha.GetPoint_WithAlpha-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.GetPoint_WithAlpha2-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png: malformed file path "resources/with_alpha.GetPoint_WithAlpha2-linux-jammy_amd64_libvips-8.12.1-Wed Feb  2 14:43:28 UTC 2022.golden.png": invalid char ':'
resources/with_alpha.GetPoint_WithAlpha2-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png: malformed file path "resources/with_alpha.GetPoint_WithAlpha2-linux-kinetic_amd64_libvips-8.13.0-Tue Aug 23 04:05:08 UTC 2022.golden.png": invalid char ':'

I think someone changed the golden image name format to include a timestamp when it was generated but it's using a formatting with colons. https://github.com/golang/go/issues/28001

Can we use a formatting that works with go get?

AttilaTheFun commented 1 year ago

@tonimelisma I think this was broken by your commit here: https://github.com/davidbyttow/govips/commit/820907b45d1c6c6f0c82c89edbf8e17fc28197af The libvips version contains the date it was built. We should sanitize this, replacing colons with hyphens or something like that.

AttilaTheFun commented 1 year ago

@tonimelisma @davidbyttow I created a PR to sanitize them here: https://github.com/davidbyttow/govips/pull/354

AttilaTheFun commented 1 year ago

Hmm @davidbyttow I thought CI would regenerate the golden images. @tonimelisma what command did you run to regenerate them? The images in the repo still have colons in their names.

tonimelisma commented 1 year ago

The CI does not change the repository contents. go test runs the test suite and if the reference images are missing, generates them. You would need to create a PR after running go test with the new reference images (and deleting the old ones)

sonu27 commented 1 year ago

Will this be fixed soon? I prevents pulling down the latest version

AttilaTheFun commented 1 year ago

@tonimelisma @davidbyttow I'm trying to regenerate the images but I can't build / test govips currently because it's trying to link the wrong libvips version 😢 https://github.com/davidbyttow/govips/issues/355 Have you seen this issue before / do you know how to resolve it?

tonimelisma commented 1 year ago

Hey @AttilaTheFun I haven't seen it. I don't think that's a govips issue, it's probably something with other tooling.

AttilaTheFun commented 1 year ago

Hmm @tonimelisma do you know how govips / cgo locates the installed vips version? I have no idea how / why it's looking for this version that doesn't exist.

AttilaTheFun commented 1 year ago

Oh! @tonimelisma I think it's an issue with the shell integrated with vscode. When I tried the same command from a regular terminal it found the correct libvips version. I'm not sure how it got messed up but I can use the regular terminal for now.

AttilaTheFun commented 1 year ago

Hmm I'm getting some CGO crashes while running tests against libvips 8.14.2_1: https://github.com/davidbyttow/govips/issues/356

sonu27 commented 1 year ago

Need a new tag. Pulling in the latest commit works now

tonimelisma commented 1 year ago

@sonu27 @AttilaTheFun apologies. I've released a new version, v2.13.0 with the latest commits.