Opened 11 years ago
Last modified 11 years ago
#759 closed defect
WCPS encode behaviour dependent on capitalisation of format specifier — at Version 2
Reported by: | Marcus Sen | Owned by: | uadhikari |
---|---|---|---|
Priority: | minor | Milestone: | 9.0.x |
Component: | petascope | Version: | development |
Keywords: | Cc: | James Passmore | |
Complexity: | Medium |
Description (last modified by )
If I submit the query:
for c in (bgs_rs) return encode( c.blue, "png" )
I get an image back with the response Content-Type header set to image/png
If I submit the query with "PNG" in capital letters I get the same image back but the response Content-Type header is set to text/plain. (Although with my browser Firefox it pops up a dialog box saying the data is application/octet-stream, presumably deciding that the Content-Type header must be wrong.)
I guess the behaviour should be the same for both or only lowercase or only uppercase versions should be allowed but I don't know where the format specifier strings are defined.
(Both queries get translated to the same underlying rasql query with capital letters:
select encode((c).blue, "PNG", "xmin=314158.77412577;xmax=574363.77412577;ymin=394361.64417978;ymax=632963.64417978;crs=EPSG:27700") from bgs_rs AS c where oid(c)=6145) from bgs_rs
Dimitar Misev commented on rasdaman-users list:
Looks like a bug worth a ticket. The format → mimetype correspondence
is defined in the ps_format table.
Change History (2)
comment:1 by , 11 years ago
Milestone: | → 9.0.x |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 11 years ago
Description: | modified (diff) |
---|
Utkrist, the mimetype is set in PetascopeInterface, you can grep in source:applications/petascope/src/main/java for mimetype to get a clue for where the problem is:
I'm suspecting the issue is somewhere in DbMetadataSource, perhaps in the formatToMimetype method.
I'm not sure how to add a test that will check for the mimetype, I think it will be hard to do it in our systemtest so a one-time manual check should be good enough for now.