malcolmmclean / tiffloader Goto Github PK
View Code? Open in Web Editor NEWPortable single file ANSI C TIFF file loader
Portable single file ANSI C TIFF file loader
I tested your library because in my own TIFF decoder I have a problem with ImageMagick's LZW files and I wanted to see how yours handles the problem, and it crashed in the function bitstreamtorgba()
while attempting to write to rgba[0]
.
Here's the file I used: https://www.mediafire.com/view/b39ooh9qemnqafl/imagemagick_lzw_8.tif/file
The file was created with the command convert.exe %1 -set colorspace RGB -resize 2000x -colorspace sRGB -depth 8 -compress lzw "imagemagick lzw 8.tif"
(I used a 32-bit linear image as input, hence the colourspace stuff, other than that it's just really the standard way to create a LZW-compressed TIFF with ImageMagick). The problem with such files is that the bit stream can sometimes contain codes that aren't yet in the dictionary, for instance the first such problematic code is a 12-bit code at bit 18751 from the beginning of the LZW strip #381 (also the one where your code crashes), the code is 3073 when the highest entry in my dictionary (and presumably yours as well) is code 2051, which shouldn't be possible. In another file I've even seen a code 364 right after the 256 clear code! (see https://stackoverflow.com/questions/55674925/decoding-tiff-lzw-codes-not-yet-in-the-dictionary)
So it appears that we both have the same problem, and apparently that would be only with files created by ImageMagick (which is kind of a big deal so I feel like I can't just ignore the problem), but the real mystery is that everybody else seems to handle the problem well, MS Paint loads the file perfectly fine for instance. How, I have no idea.
I read in the source code that tiffloader is free for public use. Is it possible to get clarification on this? Any possibility of the code being available in an BSD or MIT license?
Hello,
I'm really interested in using your code to load Tiff files.
As I found your link in a Matlab Forum, I expected to use it in Matlab.
Is it possible? And how?
Thanks for your answer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.