Recent post
28 January 2015

How to create a thumbnail of an image in Java without using external libraries

I had a situation when I want to display thumbnails of the images that my user had uploaded to my web application. A straightforward way could be to return the images in its entirety and use css techniques to scale down the image into a thumbnail. However, this is costly for my users who mainly access my web application from mobile devices.

One strategy for optimizing the web experiences of my users would be to generate the thumbnails at the server end so as to reduce the sizes of the HTTP responses that my server sends back to the mobile devices. And to reduce bloat from external libraries, I decided to use the facilities provided from Java standard libraries.

This post documents how I create a thumbnail from an image without using external Java libraries. For the sake of brevity, let's assume that we had downloaded an image via HTTP GET from a web server and saved that image to the path /images/sample.jpg.

Recent proof
15 March 2014

Proving that we can use jQuery to push a dynamically generated file to the web browser based on the user's input

In order to demonstrate the possibility of using JavaScript/jQuery to push a dynamically generated file from the server backend to the browser, a sample scenario was created.

There is a number dial that changes rapidly and a text field for the user to enter his name. When the user clicks on the "get lucky number" button, jQuery is used to send the lucky number on the number dial and the user name to the server.

The server generates a text file based on the input from the user and sends the file back to the browser. The browser will then show a download dialog box for the user to decide whether to save a copy of the file or view the file using one of the native applications found in his/her computer.

About Techcoil

Technologies coil to form a greater whole, thereby facilitating the exchange of information between people. That was how Techcoil was named.

Launched in 2010, Techcoil was designated to serve as a memory lane, as well as a testing ground for web related technologies.

We have articles to some technical problems, book recommendations for reading pleasure and self-improvement and some tools to help make some work a little bit faster.

Write to us

You need to enable JavaScript in order to write to us.