TIF files with if photo == 3 sampleformat == 1 bitspersample == 8 samplesperpixel == 1 not loading correctly
Closed this issue · 5 comments
I have a TIF file with
photo == 3
sampleformat == 1
bitspersample == 8
samplesperpixel == 1
which is a colour image but loaded into CImg it is monochrome. I could get it to load correctly by modifying the _load_tiff method to support this case:
The changed code is:
unsigned int spectrum = samplesperpixel;
if (is_spp == false || photo >= 3)
{
spectrum = photo ? 3 : 1;
}
assign(nx,ny,1,spectrum);
if (photo >= 3 && sampleformat == 1 && bitspersample == 8 && (samplesperpixel == 1 || samplesperpixel == 3 || samplesperpixel == 4)) {
I can send you the tif file as I can't attach it.
Not clear to me what is the modified code. Could you send a patch or propose a pull request ?
Hi David,
I have attached a screen shot showing
the changes. Hopefully that makes it clear. I have also attached the tif
file.
Thanks,
Neil
From:
David Tschumperlé notifications@github.com
To:
dtschump/CImg CImg@noreply.github.com
Cc:
n-brown neil.brown@listech.com
Date:
23/09/2015 03:59 PM
Subject:
Re: [CImg] TIF
files with if photo == 3 sampleformat == 1 bitspersample == 8 samplesperpixel
== 1 not loading correctly (#15)
Not clear to me what is the modified code. Could you send
a patch or propose a pull request ?
—
Reply to this email directly or view
it on GitHub.
Sorry, but I don't see any attached image in your post.
Is there something I'm missing ?
I just replied to the email and attached
two images (one png and one tif). I guess GitHub doesn't like it. Do you
have a normal email address I can send them to? My email address is neil.brown@listech.com
From:
David Tschumperlé notifications@github.com
To:
dtschump/CImg CImg@noreply.github.com
Cc:
n-brown neil.brown@listech.com
Date:
24/09/2015 04:16 PM
Subject:
Re: [CImg] TIF
files with if photo == 3 sampleformat == 1 bitspersample == 8 samplesperpixel
== 1 not loading correctly (#15)
Sorry, but I don't see any attached image in your post.
Is there something I'm missing ?
—
Reply to this email directly or view
it on GitHub.
Ok, sent you an e-mail :) Thanks again