Simon Hofer ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A4a089bea-86ca-437f-92f7-90ba3ea5c875
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiZjZhODA1M2NiNWFjNGY1YjhjYzc5MjY4OTIyNDAxMjgiLCJwIjoiaiJ9
 ) / Bug ( 
https://osgeo-org.atlassian.net/browse/GEOS-9834?atlOrigin=eyJpIjoiZjZhODA1M2NiNWFjNGY1YjhjYzc5MjY4OTIyNDAxMjgiLCJwIjoiaiJ9
 ) GEOS-9834 ( 
https://osgeo-org.atlassian.net/browse/GEOS-9834?atlOrigin=eyJpIjoiZjZhODA1M2NiNWFjNGY1YjhjYzc5MjY4OTIyNDAxMjgiLCJwIjoiaiJ9
 ) GetLegendGraphic results in java.lang.NegativeArraySizeException or 
OutOfMemory ( 
https://osgeo-org.atlassian.net/browse/GEOS-9834?atlOrigin=eyJpIjoiZjZhODA1M2NiNWFjNGY1YjhjYzc5MjY4OTIyNDAxMjgiLCJwIjoiaiJ9
 )

Issue Type: Bug Affects Versions: 2.18.1, 2.19-RC Assignee: Unassigned 
Components: WMS Created: 21/Dec/20 8:30 AM Priority: Medium Reporter: Simon 
Hofer ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A4a089bea-86ca-437f-92f7-90ba3ea5c875
 )

When requesting the GetLegendGraphic of Grouplayers I saw 
java.lang.NegativeArraySizeException or OutOfMemory exceptions (only when 
setting dpi).

Digging down the rabbit hole I found that the 
org.geoserver.wms.legendgraphic.LegendGraphicBuilder.resizeForDPI is always 
scaling the image size (w and h) with the size from before. With my some number 
of layers this ends up with an image which is bigger then Integer.MAX_VALUE 
Bytes.

I assume that following would be better than using w/h again:

           w = (( int ) Math.round(request.getWidth() * scaleFactor));
           h = (( int ) Math.round(request.getHeight() * scaleFactor));

( 
https://osgeo-org.atlassian.net/browse/GEOS-9834#add-comment?atlOrigin=eyJpIjoiZjZhODA1M2NiNWFjNGY1YjhjYzc5MjY4OTIyNDAxMjgiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-9834#add-comment?atlOrigin=eyJpIjoiZjZhODA1M2NiNWFjNGY1YjhjYzc5MjY4OTIyNDAxMjgiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100153- 
sha1:55cb54c )
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to