Skip to content

Commit

Permalink
Using characters that are not possible in a file path
Browse files Browse the repository at this point in the history
  • Loading branch information
code1super committed Jul 7, 2024
1 parent 2d6fdb0 commit 9613e3e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vips/icc_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,10 @@ var (
0x00, 0x20, 0x63, 0xcf, 0x8f, 0xf0, 0x65, 0x87, 0x4e, 0xf6, 0x00, 0x00,
}

sRGBV2MicroICCProfilePathToken = "#srgb_v2_micro.icc"
sGrayV2MicroICCProfilePathToken = "#sgray_v2_micro.icc"
sRGBIEC6196621ICCProfilePathToken = "#srgb_iec61966_2_1.icc"
genericGrayGamma22ICCProfilePathToken = "#generic_gray_gamma_2_2.icc"
sRGBV2MicroICCProfilePathToken = "\x00srgb_v2_micro.icc"
sGrayV2MicroICCProfilePathToken = "\x00sgray_v2_micro.icc"
sRGBIEC6196621ICCProfilePathToken = "\x00srgb_iec61966_2_1.icc"
genericGrayGamma22ICCProfilePathToken = "\x00generic_gray_gamma_2_2.icc"

temporaryDirectory = ""
SRGBV2MicroICCProfilePath = sRGBV2MicroICCProfilePathToken
Expand All @@ -658,7 +658,7 @@ var (

// Back support
func ensureLoadICCPath(name *string) (err error) {
if len(*name) > 0 && (*name)[0] == '#' {
if len(*name) > 0 && (*name)[0] == 0 {
switch *name {
case sRGBV2MicroICCProfilePathToken:
*name, err = GetSRGBV2MicroICCProfilePath()
Expand Down Expand Up @@ -717,7 +717,7 @@ func GetGenericGrayGamma22ICCProfilePath() (string, error) {
func getOrLoad(pathFile *string, name string, fileBytes []byte) (string, error) {
lockIcc.Lock()
defer lockIcc.Unlock()
if len(*pathFile) > 0 && (*pathFile)[0] != '#' {
if len(*pathFile) > 0 && (*pathFile)[0] != 0 {
return *pathFile, nil
}

Expand Down

0 comments on commit 9613e3e

Please sign in to comment.