• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

image compression

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai All

I have an image to upload . I set the size of it. But any client can uploading any type and any size photo. my request is that, when a client send an image, then automatically compressing or resizing the sets the image size.

i sets the image size is 190X200. this is fixed size.
but the client can uploading any size of file. that receiving after, without any defect of the picture, and adjusting to the 190X200 size.

anyone to know this please give me the code

thanks
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I had to solve that kind of problem once.

Since I used a server without any native graphics resource (headless server), I choosed to use PJA Toolkit but you probably don't need it.

Anyway, you will find a sample code about how to generate a compressed picture (thumb) in this java class using extra API such as java.awt, javax.swing, com.sun.image.codec.jpeg etc..
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We used java jdk image toolkit to compress the images(thumbnails). But make sure if you are working with web applications. If you do more compression or decompression of large images , lot of heap is used to do these kind of operations. And at one point you will be having OutOfMemory Errors.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic