﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
14972	NegativeArraySizeException when scaling an image on macOS / HiDPI	anonymous	anonymous	"==== What steps will reproduce the problem?
1. Scale image in Piclayer
==== What happens instead?
Crash! Crash! Crash! Hang!
==== Please provide any additional information below. Attach a screenshot if possible.

{{{
URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-05-29 16:19:58 +0200 (Mon, 29 May 2017)
Build-Date:2017-05-29 14:25:03
Revision:12275
Relative:URL: ^/trunk

Identification: JOSM/1.5 (12275 en) Mac OS X 10.12.5
OS Build number: Mac OS X 10.12.5 (16F73)
Memory Usage: 2221 MB / 3641 MB (738 MB allocated, but free)
Java version: 1.8.0_131-b11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: Display 69732928 1440x900
Maximum Screen Size: 1440x900
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-1553d770, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Dmacosx.jnlpx.dock.name=JOSM, -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/16/47ee53d0-6ab4d4c6.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp , -Djnlpx.jvm=""<java.home>/bin/java""]
Dataset consistency test: No problems found

Plugins:
+ PicLayer (33385)
+ buildings_tools (33004)
+ editgpx (33004)
+ reltoolbox (33311)
+ reverter (33088)
+ tageditor (33021)
+ turnlanes (33294)
+ turnlanes-tagging (254)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1

Last errors/warnings:
- E: Handled by bug report queue: java.lang.NegativeArraySizeException
- E: Handled by bug report queue: java.lang.NegativeArraySizeException


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-2 (50) of javawsApplicationThreadGroup
java.lang.NegativeArraySizeException
	at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75)
	at java.awt.image.Raster.createPackedRaster(Raster.java:467)
	at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
	at java.awt.image.BufferedImage.<init>(BufferedImage.java:351)
	at sun.lwawt.macosx.CImage.toImage(CImage.java:268)
	at sun.lwawt.macosx.CImage.lambda$toImage$2(CImage.java:262)
	at sun.awt.image.MultiResolutionCachedImage.getResolutionVariant(MultiResolutionCachedImage.java:66)
	at sun.java2d.SunGraphics2D.getResolutionVariant(SunGraphics2D.java:3198)
	at sun.java2d.SunGraphics2D.drawHiDPIImage(SunGraphics2D.java:3111)
	at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3313)
	at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3296)
	at org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract.paint(PicLayerAbstract.java:267)
	at org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable$CompatibilityModeLayerPainter.paint(AbstractMapViewPaintable.java:27)
	at org.openstreetmap.josm.gui.MapView.paintLayer(MapView.java:459)
	at org.openstreetmap.josm.gui.MapView.drawMapContent(MapView.java:526)
	at org.openstreetmap.josm.gui.MapView.paint(MapView.java:481)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JComponent.paint(JComponent.java:1065)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
}}}
"	defect	closed	normal		Plugin piclayer		needinfo	template_report macosx hidpi	
