Re: [Imaging] a quick resize sample needed

2015-06-16 Thread Siegfried Goeschl
Hi folks,

on GitHub I have sample code to resize images using different libraries

* ImageIO
* Thumbnailator
* TwelveMonkeys

https://github.com/sgoeschl/java-image-processing-survival-guide/tree/master/code/jipsg
 
https://github.com/sgoeschl/java-image-processing-survival-guide/tree/master/code/jipsg

Cheers,

Siegfried Goeschl

 On 16 Jun 2015, at 19:45, Thad Humphries thad.humphr...@gmail.com wrote:
 
 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 javalishi...@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)



Re: [Imaging] a quick resize sample needed

2015-06-16 Thread Thad Humphries
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 javalishi...@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)


Re:Re: [Imaging] a quick resize sample needed

2015-06-16 Thread javalishixml
Thank you all.
Actually, I'm writting the resize function in Java using the different libraries
Apache Common Imaging is one of my libraries. I tried to use it, but it looks 
like too little of tutorial to how-to

Can anyone help me on this Apache Common Imaging library?



Thanks,
LS

At 2015-06-17 02:06:42, Siegfried Goeschl siegfried.goes...@it20one.com 
wrote:
Hi folks,

on GitHub I have sample code to resize images using different libraries

* ImageIO
* Thumbnailator
* TwelveMonkeys

https://github.com/sgoeschl/java-image-processing-survival-guide/tree/master/code/jipsg
 
https://github.com/sgoeschl/java-image-processing-survival-guide/tree/master/code/jipsg

Cheers,

Siegfried Goeschl

 On 16 Jun 2015, at 19:45, Thad Humphries thad.humphr...@gmail.com wrote:
 
 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 javalishi...@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)



[Imaging] a quick resize sample needed

2015-06-16 Thread javalishixml
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)
{


}
}


}
--