Read Gimp's XCF image file in Java - java

Is there a Java library that can read XCF image format (GIMP native file format), i.e. into BufferedImage?
I know there is a linux script xcf2png or xcf2jpg. Is it possible to read directly from Java?

There is no available library that can read or parse XCF file. If you don't want to convert it in the first place, you should be implementing your own parser, using https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt

Related

Reading ND2 files in eclipse

I have created a GUI using java Swing which displays some images. I have been testing it and have managed to create some labels which I have filled with JPEG images as a test.
Now, I face the problem that I cannot display the actual files i need to display because they are .nd2 files (from a Nikon microscope). I have been looking at how to use the Bio-formats and/or IJ packages to do so...but I don't know where to start.
Can anyone help? I am using the Eclipse IDE for Java
About the format
From https://www.file-extensions.org/
... The ND2 format uses JPEG-2000 compression, and also can be
uncompressed or Zip-compressed ...
As mentioned in read jpeg2000 files in java
JPEG 2000 seems to be not included inside standard Java SDK.
Potential solutions
1. Use Open JPEG + existing JNI wrapper
I would try out https://github.com/uclouvain/openjpeg and search for some java wrappers to use openjpeg (e.g. look at https://github.com/barmintor/openjpeg for an JNI approach for maven).
2. Use Open JPEG + Write own JNI wrapper
Another approach would be to look at
https://github.com/ThalesGroup/JP2ForAndroid/blob/master/library/src/main/java/com/gemalto/jp2/JP2Decoder.java , inspect involved classes etc. and write an own JNI wrapper
The mentioned github reposoitory code writes to android bitmap, so not directly usable for your Swing project, but it shows you the way to decode JPEG2000 format by native calls to OpenJPEG library
How to convert a byte[] to a BufferedImage in Java? describes conversion from byte array to a buffered image - so these information should help you to read the image data into a buffered image (so usable in Swing).

read a powerPoint file using Java or Talend then upload it to SalesForce

I need to read a power-point file using Talend or Java then upload it to Salesforce and create it under Documents (standard Object).
Maybe convert it to a binary file?
Or there is an option in talend to do it?
Or creating a java method under Talend that do the job?
any help in that process will be appreciate it.
I found a way to read the ppt file but without any return in the link
http://www.coderanch.com/how-to/java/ReadPowerPoint
Talend cannot deal with powerPoint file, but you can create a static routine that use Apache POI API for that and invoke it through tJava component, to upload file you can use tFTPPut component.

Java library for extracting audio information from MP3 files

Is there any freely available library (other than java media framework) that I can use to extract the bit rate (eg. 128 kbps, VBR) and the audio quality (eg 44.1KHz, Stereo) from a MP3 file?
I would like a standalone library that I can incorporate into my application jar, to be deployed on older Macs too that have only Java 1.5 available and I can't get them upgraded or add any big Java library to.
Just to clarify: I will not play, transcode or do anything of the sort with the audio stream itself, I am interested in the metadata only.
I confess I do not know much about MP3 files, but you can see from the format specification that all the informations needed are in the 32 bits long header of the file.
You could open the MP3 with a FileInputStream, read the first 4 bytes of the file and, using some simple binary masks, retrieve the informations you need. IMHO using a specialized library for that is a bit of an overkill.
Take a look at JAudioTagger, plain simple and easy to use, the data you are looking for is into MP3AudioHeader class, with methods like getBitRate()
You can use the LAMEOnJ library:
http://openinnowhere.sourceforge.net/lameonj/
This java library is light but you must have the LAMELib installed on target computer.
I'm not a java programmer, but i'm pretty sure you could read the mp3 file into a byte array then see http://www.mp3-tech.org/programmer/frame_header.html for frame info.
This format specification shows you what's contained the MPEG (mp3) header. You can write code to retrieve this header.

NetLogo - reading and writing to a text file for Java API use

I want to use the Java API in my NetLogo program. For that, I need to write to a text file and read input from a text file. How can this be done in NetLogo?
Additionally - what are the ways by which I can integrate the Java API with NetLogo?
Yes, you can read and write to a text file from NetLogo itself. There is no need to use the Java API. Read about the file commands in the manual found here: http://ccl.northwestern.edu/netlogo/5.0/docs/programming.html#fileio

Insert Image into Excel - Java

I am working on a java web application where i have to show an image on excel file.
i used the java file iopo to write the image to the excel file.
Issue is when the user mail this to client the image does not show up
Is there any way to embed the image into the excel file using java with/without using any external API.
You can use Apache POI: http://poi.apache.org
See especially http://poi.apache.org/spreadsheet/quick-guide.html#Images
You must use an external library as there is no standard Excel API for Java.
You should use something along the lines of JExcelAPI.

Categories