Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am developing a java swing based application which show thumbnail of any format(jpg,png) images. For that, at first I read the image file by ImageIO.read(file name) and then create thumbnail of it. But it shows null pointer exception when read PSD format file.
I use ideli library for read PSD type file but it requires subcription/paid. So there have any free library to read PSD type file in Java?
image = ImageIO.read(new File(i));
thumb = Thumbnails.of(image).size(140,100).outputFormat("png").asBufferedImage();
ImageIO.write(thumb, "png", new File("thumb.png"));
By above code, I can read (without PSD) image file and create thumbnail of image.
Have a read of the documentation, PSD is not a supported format.
You might find some value from a similar question here.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am trying to make a changelog that gets updated at runtime, now, I would like to download the changelog from my website, and then display it.
How would I do this?
By the way, I just want to read the file (something like when browsers ask you do you want to save or run this file?, not save it.
Thanks.
You can open the input stream from the URI in Java as follows. Replace InputStreamReader with other implementations as per your need. Once you have the reader, you should be able to read the data from the stream.
InputStream stream = new URI('http://path-to-file').toURL().openStream();
BufferedReader r = new BufferedReader(new InputStreamReader(stream));
String content = "";
while((content = r.readLine()) != null) {
System.out.println(content); // you can put custom logic here.
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am writing a java program for fingerprint recognition, and I insert the fingerprint image in the MySQL database( in a field blob), but now is the problem.
How do I go back to the image of the fingerprint? where I have to print it?( I presume in a canvas). help me please is very important, thanks to all.
The blob is a array of bytes, so is the Image.
So
img -> read bytes -> store as blob
vs
blob -> read bytes -> store as img
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Are there any good java libraries for parsing & dealing with proprietary messages in UDP size packets? The message is a simple byte array, where each byte(s) represents enums or text/ascii values.
You could also use a ByteBuffer to wrap your byte[]
Use DataInputStream to read the type of data you want if it fits the conversions (i.e. when reading an int check the endianess used by DataNIputStream matches your platform), wrapped around a ByteArrayInputStream directly fed by your byte array.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there any Java API to get the font name from a font file (TTF)?
Sure, the java.awt.Font class will handle this task just fine. Here's how:
Font f = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream("font.ttf"));
String name = f.getName();
(I tried it on one of the ttf-fonts on my system and it works as intended.)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there any code(specifically Java or C++) or software in which we import any image and it gives the outline of that image in points, which we can use again to draw image outline by joining those points in JOGL or OPenGL ..
There's an outline tracer in Inkscape (which is open source c++).
http://inkscape.org/doc/tracing/tutorial-tracing.html
This will convert to vector format - so you could get some points out this way.
EDIT: this actually uses http://potrace.sourceforge.net/ for the tracing..
Here is an example code in MATLAB:
%# read image
I = imread('coins.png');
%# Convert to a binary image
BW = im2bw(I, graythresh(I));
%# get object boundaries
BW = imfill(BW,'holes');
B = bwboundaries(BW,'noholes');
%# plot boundaries overlayed on top of image
imshow(I), hold on
for i=1:numel(B)
plot(B{i}(:,2), B{i}(:,1), 'Color','g', 'LineWidth',2)
end
hold off