commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thad Humphries <thad.humphr...@gmail.com>
Subject Re: [Imaging] a quick resize sample needed
Date Tue, 16 Jun 2015 17:45:41 GMT
Do you necessarily need to use this library? There are other solutions
(Google java resize image). For example

http://www.codejava.net/java-se/graphics/how-to-resize-images-in-java
-- or --
http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/

On Tue, Jun 16, 2015 at 5:32 AM, javalishixml <javalishixml@163.com> wrote:

> Hi Gurus,
>
>
> Quite a silly question this is. But I really worked for one whole day but
> still could not get any result.
>
>
> I have below codes. I just want to finish a a simple function to resize
> the original picture. But I don't know how to set  its param..
> I tried to read the doc API and read the test code. But I still could not
> figure it out how to do..
>
>
> Can you plz do me a favor? Looking forward to your early reply...
>
>
>
>
>
> --------------------------------------------------------------------------------------------------------------
> public class ApacheCommonImaging {
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
>
> try
> {
> //!!!!!!!!!!!!!!
> File someFile = new File("E:\\deleteMe\\image\\original.jpg");
> File file = someFile;
> BufferedImage image_3 = Sanselan.getBufferedImage(file);
> File destination = new
> File("E:\\deleteMe\\image\\commonImaging\\destination.jpg");
> ImageFormat format1 = ImageFormat.IMAGE_FORMAT_JPEG;
> Map params = new HashMap(Object, Object);   //????
> Map params = new HashMap(JpegImageParser.TIFF_TAG_IMAGE_LENGTH, new
> TagInfo()); //????
> Sanselan.writeImage(image_3, destination, format1, params);
>
>
> }
> catch (Exception e)
> {
>
>
> }
> }
>
>
> }
>
> --------------------------------------------------------------------------------------------------------------




-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message