-
Notifications
You must be signed in to change notification settings - Fork 203
Open
Description
WebImageDecoder should take into consideration fileDirectory.SamplesPerPixel
. If it is equal to 3 it must convert buffer
from RGB to RGBA.
RGB example, file webp_rgb.tif
The output of gdalinfo
on attached webp_rgb.tif
(webp.zip)
Data axis to CRS axis mapping: 1,2
Origin = (-13044819.684176461771131,3859305.558118546847254)
Pixel Size = (0.074645535434684,-0.074645535434684)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=WEBP
INTERLEAVE=PIXEL
LAYOUT=COG
Corner Coordinates:
Upper Left (-13044819.684, 3859305.558) (117d11' 0.99"W, 32d43'42.15"N)
Lower Left (-13044819.684, 3859229.121) (117d11' 0.99"W, 32d43'40.07"N)
Upper Right (-13044743.247, 3859305.558) (117d10'58.52"W, 32d43'42.15"N)
Lower Right (-13044743.247, 3859229.121) (117d10'58.52"W, 32d43'40.07"N)
Center (-13044781.466, 3859267.340) (117d10'59.76"W, 32d43'41.11"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
When I try to render it (using cog-explorer running locally):
RGBA example, file webp_rgba.tif
The output of gdalinfo
on attached webp_rgba.tif
(webp.zip)
Data axis to CRS axis mapping: 1,2
Origin = (-13044819.684176461771131,3859305.558118546847254)
Pixel Size = (0.074645535434684,-0.074645535434684)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=WEBP
INTERLEAVE=PIXEL
LAYOUT=COG
Corner Coordinates:
Upper Left (-13044819.684, 3859305.558) (117d11' 0.99"W, 32d43'42.15"N)
Lower Left (-13044819.684, 3859229.121) (117d11' 0.99"W, 32d43'40.07"N)
Upper Right (-13044743.247, 3859305.558) (117d10'58.52"W, 32d43'42.15"N)
Lower Right (-13044743.247, 3859229.121) (117d10'58.52"W, 32d43'40.07"N)
Center (-13044781.466, 3859267.340) (117d10'59.76"W, 32d43'41.11"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Red
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
Band 2 Block=512x512 Type=Byte, ColorInterp=Green
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
Band 3 Block=512x512 Type=Byte, ColorInterp=Blue
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
Band 4 Block=512x512 Type=Byte, ColorInterp=Alpha
NoData Value=0
Overviews: 256x256, 128x128, 64x64, 32x32, 16x16, 8x8, 4x4
When I try to render it (using cog-explorer running locally), it looks fine :
geotiff.js/src/compression/webimage.js
Lines 35 to 36 in f15d770
// TODO: check how many samples per pixel we have, and return RGB/RGBA accordingly | |
// it seems like GDAL always encodes via RGBA which does not require a translation |
Environment
- Google Chrome 114.0.5735.198 (Official Build) (64-bit)
- geotiff 2.0.7
Attached two GeoTIFF files as an example
webp.zip
rgov
Metadata
Metadata
Assignees
Labels
No labels