Opened 4 years ago

Closed 4 years ago

#250 closed defect (fixed)

tRNS flag not working in latest version

Reported by: olcl@… Owned by: dmisev
Priority: major Milestone: 8.4
Component: RPM Version: 8.3
Keywords: Cc: j.oosthoek@…
Complexity:

Description

In previous versions of rasdaman and petascope it was possible to set a tRNS flag to set that colour to be transparent, like the query below :

for c in (CCI_chla_monthly)
return
encode ( (char)

((c[t(3)] >= 0.0) * c[t(3)] ) * 255, "png", "tRNS=0x00;0x00;0x00")

This query now does not return an image with any transparency as can be seen in the images attached.

Attachments (2)

image_1.png (2.2 MB) - added by olcl@… 4 years ago.
file showing old transparency ability
image_2.png (2.2 MB) - added by olcl@… 4 years ago.
image showing no transparency

Change History (9)

Changed 4 years ago by olcl@…

file showing old transparency ability

Changed 4 years ago by olcl@…

image showing no transparency

comment:1 Changed 4 years ago by dmisev

GDAL should set the NODATA value to be transparent in PNG, but I'm not sure if you can pass the NODATA value.

Can you try maybe

 for c in (CCI_chla_monthly)
return
encode ( (char)

((c[t(3)] >= 0.0) * c[t(3)] ) * 255, "png", "NODATA=0")

comment:2 Changed 4 years ago by olcl@…

Setting the NODATA flag does not cause any errors with the latest petascope but does not produce an image with transparency either.

comment:3 Changed 4 years ago by olcl@…

this ticket is mirrored on the earthserver trac @ http://212.201.49.163/trac/ticket/92

comment:4 Changed 4 years ago by dmisev

I submitted a patch that will allow to recognize the nodata parameter. Details about the parameter at the encode function page.

comment:5 Changed 4 years ago by dmisev

Alternative JSON output encoding:

$ rasql -q 'select info(c) from mr as c' --out string
rasql: rasdaman query tool v1.0, rasdaman v8.3.1-g8897c51 -- generated on 07.12.2012 16:06:36.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 4 element(s):
  Result object 1: {
 "oid": "150529",
 "baseType": "marray <char>",
 "tileNo": "1",
 "totalSize": "54016B",
 "tiling": {
	"tilingScheme": "no_tiling",
	"tileSize": "2097152",
	"tileConfiguration": "[0:511,0:511]"
 },
 "index": {
	"type": "rpt_index",
	"indexSize": "0",
	"PCTmax": "4096B",
	"PCTmin": "2048B"
 }
}

comment:6 Changed 4 years ago by dmisev

ups, wrong ticket.

comment:7 Changed 4 years ago by dmisev

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in changeset:299a268

As explained here please use the nodata parameter.

Note: See TracTickets for help on using tickets.