Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Support for RAW Images #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions libtiff/libtiff_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ def add_tags(tag_list):

TIFFTAG_CZ_LSMINFO: (c_toff_t, lambda _d: _d.value)
# offset to CZ_LSMINFO record

# Adding support for RAW images
TIFFTAG_CFAREPEATPATTERNDIM: (
ctypes.c_short * 2, lambda _d: _d.contents[:]),

TIFFTAG_CFAPATTERN: (ctypes.c_char_p, lambda _d: _d.value),

}


Expand Down Expand Up @@ -1214,16 +1221,16 @@ def NumberOfStrips(self):
def WriteScanline(self, buf, row, sample=0):
return libtiff.TIFFWriteScanline(self, buf, row, sample)
writescanline = WriteScanline

@debug
def ReadScanline(self, buf, row, sample=0):
def ReadScanline(self, buf, row, sample=0):
return libtiff.TIFFReadScanline(self, buf, row, sample)
readscanline = ReadScanline
def ScanlineSize(self):

def ScanlineSize(self):
return libtiff.TIFFScanlineSize(self).value
scanlinesize = ScanlineSize

# @debug
def ReadRawStrip(self, strip, buf, size):
return libtiff.TIFFReadRawStrip(self, strip, buf, size).value
Expand Down