Opened 12 years ago

Closed 12 years ago

#250 closed defect (fixed)

tRNS flag not working in latest version

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

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@… 12 years ago.
file showing old transparency ability
image_2.png (2.2 MB ) - added by olcl@… 12 years ago.
image showing no transparency

Change History (9)

by olcl@…, 12 years ago

Attachment: image_1.png added

file showing old transparency ability

by olcl@…, 12 years ago

Attachment: image_2.png added

image showing no transparency

comment:1 by Dimitar Misev, 12 years ago

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 by olcl@…, 12 years ago

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

comment:3 by olcl@…, 12 years ago

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

comment:4 by Dimitar Misev, 12 years ago

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

comment:5 by Dimitar Misev, 12 years ago

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 by Dimitar Misev, 12 years ago

ups, wrong ticket.

comment:7 by Dimitar Misev, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in changeset:299a268

As explained here please use the nodata parameter.

Note: See TracTickets for help on using tickets.