Solved

Open Source Java Image Creation Library

Posted on 2011-03-22
13
394 Views
Last Modified: 2012-05-11
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
Comment
Question by:cgray1223
  • 5
  • 3
  • 3
  • +1
13 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 35196286
You mean you want to scale the pictures?
What is the format of image files which your are uploading?
0
 
LVL 86

Expert Comment

by:CEHJ
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

by:objects
ID: 35197118
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 92

Expert Comment

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

Author Comment

by:cgray1223
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

by:for_yan
ID: 35200416



These are some more links about resizing and preparing Thumbnails of
 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

by:objects
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

by:cgray1223
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

by:objects
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[].

the uploaded image should already be a byte array

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35203369
0
 

Author Comment

by:cgray1223
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!


BufferedImage image = ImageIO.read(new File("C:\\Users\\User\\Downloads\\picture.jpg"));
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35210266
For InputStream 'in':


BufferedImage image = ImageIO.read(in);

Open in new window

0
 
LVL 92

Accepted Solution

by:
objects earned 500 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?  

http://helpdesk.objects.com.au/java/how-do-i-read-an-image-from-an-input-stream

> Thanks for all your help!

no worries :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb on wildfly 5 48
Why is enum singleton a better approach than static factory 3 52
intellij error 2 33
jsp error 6 47
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question