Latest Icy update breaks filesaver from script editor?

33 views
Skip to first unread message

Nicoco

unread,
Jun 9, 2016, 10:34:37 AM6/9/16
to Icy imaging
I cannot save images in my scripts, I believe it is related to the latest Icy update.

A quick test script:
importClass(Packages.icy.image.IcyBufferedImage)
importClass
(Packages.icy.type.DataType)
importClass
(Packages.icy.file.Saver)
importClass
(Packages.java.io.File)

binaryImage
= new IcyBufferedImage(100, 100, 1, DataType.BYTE)
outputFile
= new File("/tmp/test.png")
Saver.saveImage(binaryImage, outputFile, true)


returns:
Wrapped java.lang.NullPointerException (script#9)

Any workaround?

Osvaldo Fuica

unread,
Jun 9, 2016, 1:32:25 PM6/9/16
to Icy imaging
Hi Nicoco, 

It seems that the "saveImage" function in the last release is broken.

You can create a Sequence and then save it.
Here you have a simple example.

importClass(Packages.icy.image.IcyBufferedImage)
importClass
(Packages.icy.type.DataType)
importClass
(Packages.icy.file.Saver)
importClass
(Packages.java.io.File)
importClass
(Packages.icy.sequence.Sequence)



binaryImage
= new IcyBufferedImage(100, 100, 1, DataType.BYTE)
outputFile
= new File("/tmp/test.png")

sequence
= new Sequence(binaryImage)
Saver.save(sequence, outputFile)

Best, 

Nicoco

unread,
Jun 10, 2016, 5:30:11 AM6/10/16
to Icy imaging
Thanks for the tip, but this is WAAAAAAYYYYY slower than saving the image directly. :(

I guess I'm going to investigate how to revert to the previous version of Icy.

Stephane

unread,
Jun 13, 2016, 6:00:40 AM6/13/16
to Icy imaging
Hi Nicoco,

Indeed there is a minor bug with the last version with the metadata affecting that particular save method, i think it's related to the Bio-Formats version we are using as well. We will dispatch a fix in the day to address that problem !

Best,

- Stephane

Stephane

unread,
Jun 13, 2016, 7:42:14 AM6/13/16
to Icy imaging
Fix included in Icy 1.8.3.0 :)

Nicoco

unread,
Jun 13, 2016, 10:14:25 AM6/13/16
to Icy imaging
Great! Thanks a lot.
Reply all
Reply to author
Forward
0 new messages