Solved

Open Source Java Image Creation Library

Posted on 2011-03-22
13
384 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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
let me know if you need help with anything specific
0
 

Author Comment

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



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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 92

Expert Comment

by:objects
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:cgray1223
Comment Utility
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
Comment Utility
For InputStream 'in':


BufferedImage image = ImageIO.read(in);

Open in new window

0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
Comment Utility
> 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 55
unix in java example 9 36
Strange loading of website behaviour 3 22
thymeleaf natural templating vs JSP 2 22
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now