Skip to content

Compression 2 support patch #2

@i2534

Description

@i2534

When I process some sepical tiff, return tiff: unsupported feature: compression value 2
Use AI, I add an patch process it

`
--- reader.go
+++ reader.go
@@ -796,6 +796,12 @@
order := ccittFillOrder(d.firstVal(tFillOrder))
r := ccitt.NewReader(io.NewSectionReader(d.r, offset, n), order, ccitt.Group3, blkW, blkH, &ccitt.Options{Invert: inv, Align: false})
d.buf, err = io.ReadAll(r)

  •   	case cCCITT:
    
  •   		// Compression 2: CCITT 1D, byte-aligned, no EOL (baseline TIFF).
    
  •   		inv := d.firstVal(tPhotometricInterpretation) == pWhiteIsZero
    
  •   		order := ccittFillOrder(d.firstVal(tFillOrder))
    
  •   		r := ccitt.NewReader(io.NewSectionReader(d.r, offset, n), order, ccitt.Group3, blkW, blkH, &ccitt.Options{Invert: inv, Align: true})
    
  •   		d.buf, err = io.ReadAll(r)
      	case cG4:
      		inv := d.firstVal(tPhotometricInterpretation) == pWhiteIsZero
      		order := ccittFillOrder(d.firstVal(tFillOrder))
    

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions