Quantcast

[gdal-dev] MrSID Color Spaces

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gdal-dev] MrSID Color Spaces

Martin Chapman-3

Even or Frank or whoever it may concern,

 

Not a big deal but I was trying to open a JP2 file using the MrSID driver and noticed that the mrsiddataset.cpp does not identify the color spaces MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM configurations in the MrSIDRasterBand() constructor.  I happen to have a two band JP2 that is a grayscale image with an alpha channel.   The color interpretation comes back as GCI_undefined.  Not that important but if you ever feel like fixing it, that would be nice.

 

The fix would go somewhere close to line 485 in mrsiddataset.cpp.  Basically just need to add a couple of more case statements in the switch statement.

 

FYI, it does however correctly identify the color interpretation when the jp2 file is RGBA.

 

Best regards,

Martin


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

Even Rouault-2

On mardi 16 mai 2017 10:13:52 CEST Martin Chapman wrote:

> Even or Frank or whoever it may concern,

>

>

>

> Not a big deal but I was trying to open a JP2 file using the MrSID driver

> and noticed that the mrsiddataset.cpp does not identify the color spaces

> MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM

> configurations in the MrSIDRasterBand() constructor. I happen to have a two

> band JP2 that is a grayscale image with an alpha channel. The color

> interpretation comes back as GCI_undefined. Not that important but if you

> ever feel like fixing it, that would be nice.

>

>

>

> The fix would go somewhere close to line 485 in mrsiddataset.cpp. Basically

> just need to add a couple of more case statements in the switch statement.

 

Martin,

 

Seems you are closed to a patch. Can you provide it ?

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

SIMON Nicolas

Martin,

Could you test this patch ?

Nicolas

 

De : gdal-dev [mailto:[hidden email]] De la part de Even Rouault
Envoyé : mardi 16 mai 2017 18:28
À : Martin Chapman
Cc : [hidden email]
Objet : Re: [gdal-dev] MrSID Color Spaces

 

On mardi 16 mai 2017 10:13:52 CEST Martin Chapman wrote:

> Even or Frank or whoever it may concern,

>

>

>

> Not a big deal but I was trying to open a JP2 file using the MrSID driver

> and noticed that the mrsiddataset.cpp does not identify the color spaces

> MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM

> configurations in the MrSIDRasterBand() constructor. I happen to have a two

> band JP2 that is a grayscale image with an alpha channel. The color

> interpretation comes back as GCI_undefined. Not that important but if you

> ever feel like fixing it, that would be nice.

>

>

>

> The fix would go somewhere close to line 485 in mrsiddataset.cpp. Basically

> just need to add a couple of more case statements in the switch statement.

 

Martin,

 

Seems you are closed to a patch. Can you provide it ?

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

mrsiddataset.cpp.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

Martin Chapman-3

Nicolas,

 

Looks good bud!  Thanks!

 

Best regards,

Martin

 

From: SIMON Nicolas [mailto:[hidden email]]
Sent: Wednesday, May 17, 2017 4:41 AM
To: Martin Chapman
Cc: [hidden email]; Even Rouault
Subject: RE: [gdal-dev] MrSID Color Spaces

 

Martin,

Could you test this patch ?

Nicolas

 

De : gdal-dev [[hidden email]] De la part de Even Rouault
Envoyé : mardi 16 mai 2017 18:28
À : Martin Chapman
Cc : [hidden email]
Objet : Re: [gdal-dev] MrSID Color Spaces

 

On mardi 16 mai 2017 10:13:52 CEST Martin Chapman wrote:

> Even or Frank or whoever it may concern,

>

>

>

> Not a big deal but I was trying to open a JP2 file using the MrSID driver

> and noticed that the mrsiddataset.cpp does not identify the color spaces

> MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM

> configurations in the MrSIDRasterBand() constructor. I happen to have a two

> band JP2 that is a grayscale image with an alpha channel. The color

> interpretation comes back as GCI_undefined. Not that important but if you

> ever feel like fixing it, that would be nice.

>

>

>

> The fix would go somewhere close to line 485 in mrsiddataset.cpp. Basically

> just need to add a couple of more case statements in the switch statement.

 

Martin,

 

Seems you are closed to a patch. Can you provide it ?

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

Even Rouault-2

On mercredi 17 mai 2017 08:26:00 CEST Martin Chapman wrote:

> Nicolas,

>

>

>

> Looks good bud! Thanks!

 

I've just applied it to trunk, but couldn't really test it since it seems my MrSID version doesn't have those #define

 

Even

 

>

>

>

> Best regards,

>

> Martin

>

>

>

> From: SIMON Nicolas [mailto:[hidden email]]

> Sent: Wednesday, May 17, 2017 4:41 AM

> To: Martin Chapman

> Cc: [hidden email]; Even Rouault

> Subject: RE: [gdal-dev] MrSID Color Spaces

>

>

>

> Martin,

>

> Could you test this patch ?

>

> Nicolas

>

>

>

> De : gdal-dev [mailto:[hidden email]] De la part de Even

> Rouault

> Envoyé : mardi 16 mai 2017 18:28

> À : Martin Chapman

> Cc : [hidden email]

> Objet : Re: [gdal-dev] MrSID Color Spaces

>

> On mardi 16 mai 2017 10:13:52 CEST Martin Chapman wrote:

> > Even or Frank or whoever it may concern,

> >

> >

> >

> >

> >

> >

> >

> > Not a big deal but I was trying to open a JP2 file using the MrSID driver

> >

> > and noticed that the mrsiddataset.cpp does not identify the color spaces

> >

> > MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM

> >

> > configurations in the MrSIDRasterBand() constructor. I happen to have a

>

> two

>

> > band JP2 that is a grayscale image with an alpha channel. The color

> >

> > interpretation comes back as GCI_undefined. Not that important but if you

> >

> > ever feel like fixing it, that would be nice.

> >

> >

> >

> >

> >

> >

> >

> > The fix would go somewhere close to line 485 in mrsiddataset.cpp.

>

> Basically

>

> > just need to add a couple of more case statements in the switch statement.

>

> Martin,

>

>

>

> Seems you are closed to a patch. Can you provide it ?

>

>

>

> Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

Martin Chapman-3

It’s an enum value defined in at least version 8.0 and greater.  Maybe in earlier versions but I am using version 9.1.

 

Martin

 

From: Even Rouault [mailto:[hidden email]]
Sent: Wednesday, May 17, 2017 8:39 AM
To: Martin Chapman
Cc: 'SIMON Nicolas'; [hidden email]
Subject: Re: [gdal-dev] MrSID Color Spaces

 

On mercredi 17 mai 2017 08:26:00 CEST Martin Chapman wrote:

> Nicolas,

>

>

>

> Looks good bud! Thanks!

 

I've just applied it to trunk, but couldn't really test it since it seems my MrSID version doesn't have those #define

 

Even

 

>

>

>

> Best regards,

>

> Martin

>

>

>

> From: SIMON Nicolas [[hidden email]]

> Sent: Wednesday, May 17, 2017 4:41 AM

> To: Martin Chapman

> Cc: [hidden email]; Even Rouault

> Subject: RE: [gdal-dev] MrSID Color Spaces

>

>

>

> Martin,

>

> Could you test this patch ?

>

> Nicolas

>

>

>

> De : gdal-dev [[hidden email]] De la part de Even

> Rouault

> Envoyé : mardi 16 mai 2017 18:28

> À : Martin Chapman

> Cc : [hidden email]

> Objet : Re: [gdal-dev] MrSID Color Spaces

>

> On mardi 16 mai 2017 10:13:52 CEST Martin Chapman wrote:

> > Even or Frank or whoever it may concern,

> >

> >

> >

> >

> >

> >

> >

> > Not a big deal but I was trying to open a JP2 file using the MrSID driver

> >

> > and noticed that the mrsiddataset.cpp does not identify the color spaces

> >

> > MRSID_LTI_COLORSPACE_GRAYSCALEA and MRSID_LTI_COLORSPACE_GRAYSCALEA_PM

> >

> > configurations in the MrSIDRasterBand() constructor. I happen to have a

>

> two

>

> > band JP2 that is a grayscale image with an alpha channel. The color

> >

> > interpretation comes back as GCI_undefined. Not that important but if you

> >

> > ever feel like fixing it, that would be nice.

> >

> >

> >

> >

> >

> >

> >

> > The fix would go somewhere close to line 485 in mrsiddataset.cpp.

>

> Basically

>

> > just need to add a couple of more case statements in the switch statement.

>

> Martin,

>

>

>

> Seems you are closed to a patch. Can you provide it ?

>

>

>

> Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

Even Rouault-2

On mercredi 17 mai 2017 09:10:42 CEST Martin Chapman wrote:

> It’s an enum value defined in at least version 8.0 and greater. Maybe in

> earlier versions but I am using version 9.1.

>

 

Indeed, that's an *enum value*, not a #define !

 

typedef enum LTIColorSpace

{

[...]

LTI_COLORSPACE_GRAYSCALEA = LTI_COLORSPACE_GRAYSCALE | LTI_COLORSPACE_MASK_ALPHA,

LTI_COLORSPACE_GRAYSCALEA_PM = LTI_COLORSPACE_GRAYSCALEA | LTI_COLORSPACE_MASK_ALPHA_PRE_MULTIPLIED,

 

 

I interpreted your "Looks good" as "applied and successfully tested"...

 

I do have SDK 8 indeed, so I replaced the conditional test with:

 

#if defined(LTI_SDK_MAJOR) && LTI_SDK_MAJOR >= 8

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MrSID Color Spaces

Martin Chapman-3

Even,

 

That’s correct, I did not actually build it.  Our third party libraries are built by another person on the team and it doesn’t happen quick.  I thought he was asking me whether it looks correct.  I apologize for the mis-communication.

 

Best regards,

Martin

 

From: Even Rouault [mailto:[hidden email]]
Sent: Wednesday, May 17, 2017 9:31 AM
To: Martin Chapman
Cc: 'SIMON Nicolas'; [hidden email]
Subject: Re: [gdal-dev] MrSID Color Spaces

 

On mercredi 17 mai 2017 09:10:42 CEST Martin Chapman wrote:

> It’s an enum value defined in at least version 8.0 and greater. Maybe in

> earlier versions but I am using version 9.1.

>

 

Indeed, that's an *enum value*, not a #define !

 

typedef enum LTIColorSpace

{

[...]

LTI_COLORSPACE_GRAYSCALEA = LTI_COLORSPACE_GRAYSCALE | LTI_COLORSPACE_MASK_ALPHA,

LTI_COLORSPACE_GRAYSCALEA_PM = LTI_COLORSPACE_GRAYSCALEA | LTI_COLORSPACE_MASK_ALPHA_PRE_MULTIPLIED,

 

 

I interpreted your "Looks good" as "applied and successfully tested"...

 

I do have SDK 8 indeed, so I replaced the conditional test with:

 

#if defined(LTI_SDK_MAJOR) && LTI_SDK_MAJOR >= 8

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...