[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
Solved

# Open Source Java Image Creation Library

Posted on 2011-03-22
Medium Priority
401 Views
Hello,

Anyone have any recommendations on an open source library I can use to create Images from  user uploaded images.  I have the file upload part working but I need to take that image and create a two new ones with a default width and a height that is in proportion and then store those on a linux box.  Thanks for the suggestions!
0
Question by:cgray1223
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 5
• 3
• 3
• +1

LVL 47

Expert Comment

ID: 35196286
You mean you want to scale the pictures?
0

LVL 86

Expert Comment

ID: 35196363
Try JMagick - it's fast and you'll probably find that at least some of the dependencies are already installed:

http://javabog.dk/jmagick/old_website/www.yeo.id.au/jmagick/
0

LVL 92

Expert Comment

ID: 35197118
0

LVL 92

Expert Comment

ID: 35197134
let me know if you need help with anything specific
0

Author Comment

ID: 35197715
A user is uploading files of type jpg, gif and png and then I need to take those and resize them.  One a thumbnail and one a larger image.
0

LVL 47

Expert Comment

ID: 35200416

jpg and other image files using Java:

http://www.velocityreviews.com/forums/t292186-java-thumbnail-resize-image-app.html

http://www.mkyong.com/java/how-to-resize-an-image-in-java/
0

LVL 92

Expert Comment

ID: 35202716
you would either read image from stream, or read it from a the byte array read from user using ImageIO
then you can resize it using Java2D
0

Author Comment

ID: 35203253
Where I'm not sure is that I can go one of two routes.  I can store the uploaded file in some temp directory and create two images from it or I can convert the upload image into a byte[].  What is easier to work with?  I just need to take the incoming file and create a 200x200 and a 800x800 image from it.  Thanks for all the help!
0

LVL 92

Expert Comment

ID: 35203286
you don't need to create a file, you can process the image directly

>  or I can convert the upload image into a byte[].

0

LVL 86

Expert Comment

ID: 35203369
0

Author Comment

ID: 35209717
Objects,
I have the below code I want to use but instead of a file I have a InputStream inputStream = event.getFile().getInputstream(); How do I create a BufferedImage using an InputStream?  Thanks for all your help!

0

LVL 86

Expert Comment

ID: 35210266
For InputStream 'in':

BufferedImage image = ImageIO.read(in);

0

LVL 92

Accepted Solution

objects earned 2000 total points
ID: 35210928
> I have the below code I want to use but instead of a file I have a InputStream inputStream = event.getFile().getInputstream(); How do I create a BufferedImage using an InputStream?

> Thanks for all your help!

no worries :)
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
###### Suggested Courses
Course of the Month14 days, 5 hours left to enroll