mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
571 stars 176 forks source link

It8 get wrong strings when SAMPLE_NAME start with number. #397

Closed diuming closed 1 year ago

diuming commented 1 year ago

LCMS2 version: 2.15 Platform: macOS 13.5.1

I try to get all SAMPLE_NAME strings. there are some wrong strings when SAMPLE_NAME start with number. take a look Result Patch Name: 79 SAMPLE_NAME: Z32A1 actually is 79 2A1 in CGSTA file.

C code

int main(int argc, const char * argv[]) {
    cmsHANDLE cgatsHandle = cmsIT8LoadFromFile(NULL, "IDEAlliance ISO 12647-7 Control Wedge 2013.txt");
    if (cgatsHandle == NULL) {
        return 99;
    }

    int count = cmsIT8GetPropertyDbl(cgatsHandle, "NUMBER_OF_SETS");
    for (int i = 0; i < count; i++) {
        const char* pName = cmsIT8GetPatchName(cgatsHandle, i, NULL);
        const char* sName = cmsIT8GetData(cgatsHandle, pName, "SAMPLE_NAME");
        printf("Patch Name: %s SAMPLE_NAME: %s\n", pName, sName);
    }

    return 0;
}

Result

Patch Name: 1 SAMPLE_NAME: A1
Patch Name: 2 SAMPLE_NAME: A2
Patch Name: 3 SAMPLE_NAME: A3
Patch Name: 4 SAMPLE_NAME: B1
Patch Name: 5 SAMPLE_NAME: B2
Patch Name: 6 SAMPLE_NAME: B3
Patch Name: 7 SAMPLE_NAME: C1
Patch Name: 8 SAMPLE_NAME: C2
Patch Name: 9 SAMPLE_NAME: C3
Patch Name: 10 SAMPLE_NAME: D1
Patch Name: 11 SAMPLE_NAME: D2
Patch Name: 12 SAMPLE_NAME: D3
Patch Name: 13 SAMPLE_NAME: E1
Patch Name: 14 SAMPLE_NAME: E2
Patch Name: 15 SAMPLE_NAME: E3
Patch Name: 16 SAMPLE_NAME: F1
Patch Name: 17 SAMPLE_NAME: F2
Patch Name: 18 SAMPLE_NAME: F3
Patch Name: 19 SAMPLE_NAME: G1
Patch Name: 20 SAMPLE_NAME: G2
Patch Name: 21 SAMPLE_NAME: G3
Patch Name: 22 SAMPLE_NAME: H1
Patch Name: 23 SAMPLE_NAME: H2
Patch Name: 24 SAMPLE_NAME: H3
Patch Name: 25 SAMPLE_NAME: I1
Patch Name: 26 SAMPLE_NAME: I2
Patch Name: 27 SAMPLE_NAME: I3
Patch Name: 28 SAMPLE_NAME: J1
Patch Name: 29 SAMPLE_NAME: J2
Patch Name: 30 SAMPLE_NAME: J3
Patch Name: 31 SAMPLE_NAME: K1
Patch Name: 32 SAMPLE_NAME: K2
Patch Name: 33 SAMPLE_NAME: K3
Patch Name: 34 SAMPLE_NAME: L1
Patch Name: 35 SAMPLE_NAME: L2
Patch Name: 36 SAMPLE_NAME: L3
Patch Name: 37 SAMPLE_NAME: M1
Patch Name: 38 SAMPLE_NAME: M2
Patch Name: 39 SAMPLE_NAME: M3
Patch Name: 40 SAMPLE_NAME: N1
Patch Name: 41 SAMPLE_NAME: N2
Patch Name: 42 SAMPLE_NAME: N3
Patch Name: 43 SAMPLE_NAME: O1
Patch Name: 44 SAMPLE_NAME: O2
Patch Name: 45 SAMPLE_NAME: O3
Patch Name: 46 SAMPLE_NAME: P1
Patch Name: 47 SAMPLE_NAME: P2
Patch Name: 48 SAMPLE_NAME: P3
Patch Name: 49 SAMPLE_NAME: Q1
Patch Name: 50 SAMPLE_NAME: Q2
Patch Name: 51 SAMPLE_NAME: Q3
Patch Name: 52 SAMPLE_NAME: R1
Patch Name: 53 SAMPLE_NAME: R2
Patch Name: 54 SAMPLE_NAME: R3
Patch Name: 55 SAMPLE_NAME: S1
Patch Name: 56 SAMPLE_NAME: S2
Patch Name: 57 SAMPLE_NAME: S3
Patch Name: 58 SAMPLE_NAME: T1
Patch Name: 59 SAMPLE_NAME: T2
Patch Name: 60 SAMPLE_NAME: T3
Patch Name: 61 SAMPLE_NAME: U1
Patch Name: 62 SAMPLE_NAME: U2
Patch Name: 63 SAMPLE_NAME: U3
Patch Name: 64 SAMPLE_NAME: V1
Patch Name: 65 SAMPLE_NAME: V2
Patch Name: 66 SAMPLE_NAME: V3
Patch Name: 67 SAMPLE_NAME: W1
Patch Name: 68 SAMPLE_NAME: W2
Patch Name: 69 SAMPLE_NAME: W3
Patch Name: 70 SAMPLE_NAME: X1
Patch Name: 71 SAMPLE_NAME: X2
Patch Name: 72 SAMPLE_NAME: X3
Patch Name: 73 SAMPLE_NAME: Y1
Patch Name: 74 SAMPLE_NAME: Y2
Patch Name: 75 SAMPLE_NAME: Y3
Patch Name: 76 SAMPLE_NAME: Z1
Patch Name: 77 SAMPLE_NAME: Z2
Patch Name: 78 SAMPLE_NAME: Z3
Patch Name: 79 SAMPLE_NAME: Z32A1
Patch Name: 80 SAMPLE_NAME: Z32A12A2
Patch Name: 81 SAMPLE_NAME: Z32A12A22A3
Patch Name: 82 SAMPLE_NAME: Z32A12A22A32B1
Patch Name: 83 SAMPLE_NAME: Z32A12A22A32B12B2
Patch Name: 84 SAMPLE_NAME: Z32A12A22A32B12B22B3

IDEAlliance ISO 12647-7 Control Wedge 2013.txt