Skip to content

LASER SWEEP Bug fix #134

@Birdasaur

Description

@Birdasaur

there appears to be a potential bug if the users local directory system isn't properly configured. Need to make this code more robust and configurable.

ResourceUtils.saveImageFile should not assume the basepath nor filename prefix. These should be passed in.

public static File saveImageFile(Image image) throws IOException {

    File newFile = new File("imagery/Trinity-scan-" + UUID.randomUUID().toString() + ".png");
    BufferedImage buff = SwingFXUtils.fromFXImage(image, null);
    ImageIO.write(buff, "PNG", newFile);
    return newFile;
}

Relevant stacktrace:

2025-10-31 13:37:37,828 WARN [atomic-processor-1] c.g.s.w.d.b.WebcamDefaultDevice [WebcamDefaultDevice.java:358] Different size obtained vs requested - [176x144] vs [160x120]. Setting correct one. New size is [160x120] java.io.FileNotFoundException: imagery\Trinity-scan-822bd953-f464-4b9e-b63b-fe84e4a28275.png (The system cannot find the path specified) at java.base/java.io.RandomAccessFile.open0(Native Method) at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:338) at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:257) at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:211) at java.desktop/javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:67) at java.desktop/com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:55) at java.desktop/javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:375) at java.desktop/javax.imageio.ImageIO.write(ImageIO.java:1504) at edu.jhuapl.trinity@2025.10.31/edu.jhuapl.trinity.utils.ResourceUtils.saveImageFile(ResourceUtils.java:223) at edu.jhuapl.trinity@2025.10.31/edu.jhuapl.trinity.javafx.components.panes.HyperdrivePane.lambda$new$94(HyperdrivePane.java:1297) at javafx.base@25.0.1/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247) at javafx.base@25.0.1/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base@25.0.1/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232) at javafx.base@25.0.1/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189) at javafx.base@25.0.1/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base@25.0.1/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base@25.0.1/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@25.0.1/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@25.0.1/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@25.0.1/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@25.0.1/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@25.0.1/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base@25.0.1/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base@25.0.1/javafx.event.Event.fireEvent(Event.java:199) at javafx.graphics@25.0.1/javafx.scene.Node.fireEvent(Node.java:9026) at edu.jhuapl.trinity@2025.10.31/edu.jhuapl.trinity.javafx.javafx3d.Hyperspace3DPane.lambda$opticonScan$0(Hyperspace3DPane.java:995) at javafx.graphics@25.0.1/com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(TimelineClipCore.java:239) at javafx.graphics@25.0.1/com.sun.scenario.animation.shared.TimelineClipCore.playTo(TimelineClipCore.java:180) at javafx.graphics@25.0.1/javafx.animation.Timeline.doPlayTo(Timeline.java:172) at javafx.graphics@25.0.1/javafx.animation.AnimationAccessorImpl.playTo(AnimationAccessorImpl.java:39) at javafx.graphics@25.0.1/com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(SingleLoopClipEnvelope.java:103) at javafx.graphics@25.0.1/javafx.animation.Animation.doTimePulse(Animation.java:1234) at javafx.graphics@25.0.1/javafx.animation.Animation$1.timePulse(Animation.java:190) at javafx.graphics@25.0.1/com.sun.scenario.animation.AbstractPrimaryTimer.timePulseImpl(AbstractPrimaryTimer.java:326) at javafx.graphics@25.0.1/com.sun.scenario.animation.AbstractPrimaryTimer$MainLoop.run(AbstractPrimaryTimer.java:247) at javafx.graphics@25.0.1/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:588) at javafx.graphics@25.0.1/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:572) at javafx.graphics@25.0.1/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:565) at javafx.graphics@25.0.1/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$0(QuantumToolkit.java:346) at javafx.graphics@25.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at javafx.graphics@25.0.1/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics@25.0.1/com.sun.glass.ui.win.WinApplication.lambda$runLoop$0(WinApplication.java:168) at java.base/java.lang.Thread.run(Thread.java:1474) 2025-10-31 13:37:48,811 ERROR [JavaFX Application Thread] e.j.t.j.c.p.HyperdrivePane [HyperdrivePane.java:1309] null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions