image converter
DESCRIPTION
At a time, it can convert large amount of BMP/PNG/GIF images to JPG/JPEG image format with same dimension and resolution. When bmp images are converted to JPG images, its size extensively reduced but dimension and resolution remains unchanged. You can convert image to Byte Array & store in Database and whenever require, it can be retrieved.TRANSCRIPT
Page 1
“IMAGE CONVERTER SOFTWARE”
Submitted by :-
NAVIN KUMAR
ROLL : 09EAXEC075
Class : B. Tech (ECE) - 4rd Year.
College : Apex Institute of Engineering
& Technology, Jaipur.
A
Industrial Training Project Report
on
Organization :
HCL Infosystems Ltd, Jaipur.
Introduction
System and Software Required
Working
Advantages
Applications
CONTENTS
INTRODUCTION
Image Converter Software is made in Java Environment which can run on
any operating system.
At a time, it can convert large amount of BMP/PNG/GIF images to
JPG/JPEG image format with same dimension and resolution.
When bmp images are converted to JPG images, its size extensively
reduced but dimension and resolution remains unchanged.
You can convert image to Byte Array & store in Database and whenever
require, it can be retrieved.
SYSTEM AND SOFTWARE REQUIRED
Operating System :
• Windows XP.
• Windows 7.
Java Platform :
• Version 6
Database :
• Microsoft SQL Server 2005 or MySQL.
IDE :
• Eclipse IDE for Java
Creating Table In Database (MS SQL Server)
To Create a Table :create table s_pht(
pht_kid int primary key not null identity(10,1),
pht_name varchar(50) not null,
pht_file image not null)
Table Name : s_pht
3 Columns : pht_kid, pht_name & pht_file
To See Content of Table :select *from s_pht
pht_kid pht_name pht_file
1 10
2 11
3 12
4 13
JDBC Connectionimport java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Abc {
private Statement getstatement(){
String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=apex;";
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection con = DriverManager.getConnection(connectionUrl,"sa",“pass");
return con.createStatement();
}
catch(Exception e){ e.printStackTrace(); }
return null;
}
public static void main(String args[]){
Abc mncls = new Abc();
try {
Statement stmt = mncls.getstatement();
String sql = "insert into btech(sno,name,percentage,semester) " +" values (4,'Ravish',84.01,5)";
stmt.execute(sql);
sql = "select * from btech";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
System.out.println(rs.getString(1)); System.out.println(rs.getString(2)); } }
catch(Exception e){ e.printStackTrace(); }
}
}
UserID Password
Load Driver
Use ResultSet to iterate
and access the data.
Creating Java Program
Create New Project
Create New Package
Create New Java Class(s)
[ .java file(s) ]
Implement Interface(s)
Import Package(s)
Extend Class(s)
JDBC Driver
Database Connection
[ .class file(s) ]
R
U
N
In order to write a java program in Eclipse IDE, steps may be as follows :
Selecting File/Directory For Old Path
By clicking on Browse Button which is in front of Old Path, File/Directory
chooser will open.
Path of selected file/directory will automatically copy to the corresponding
Text Field.
Selecting Directory For New Path
By clicking on Browse Button which is in front of New Path, Directory
chooser will open.
Path of selected directory will automatically copy to the corresponding
Text Field.
Conversion of Images to jpg/jpeg format
When Button “Convert” is clicked/pressed, all images from source
directory(Old Path) is converted to JPG/JPEG format and stored at
destination directory(New Path).
Disruption of Obstruction During
Image Conversion
If old path and/or new path are not provided then an error message will be
generated.
BMP Image Vs. JPEG Image
A bitmap(BMP) file is one that is made up of pixels in a grid. It is a
resolution dependent image, so it’s very difficult to increase the size of a
bitmap graphic without a noticeable decrease in quality.
Joint Photographic Experts Group (JPEG) or JPG files are a type of
compressed bitmap file. This lossy compression technique reduces the size
of an image by discarding details that are typically too insignificant for the
human eye to detect.
JPEG file format supports 16 million colours, it does a very good job of
analysing what data is the most important to a particular image.
Save Image To Database
When Button “Save To DataBase” is clicked/pressed then all JPG/JPEG
images at “New Path” is save to the database in byte array format.
Images Stored In Database
JPG images are stored in database in Byte Array format.
Each images stored in database with unique id.
Images in Byte Array FormatUnique ID
Disruption of Obstruction During
Saving of Images in Database
If New Path is not provided then an error message will be generated.
Continued……. If program is not successfully connected to database due to invalid user,
password, driver, etc. then an error message will be generated.
Retrieve Images From Database
When Button “Upload” is clicked/pressed, images from database which is
stored in Byte Array format is uploaded at Old Path location in JPG
format.
Disruption of Obstruction During
Upload of Images From Database
If Old Path is not provided then an error message will be generated.
Continued……. During upload, if program is not successfully connected to database due to
invalid user, password, driver, etc. then an error message will be generated.
ADVANTAGES
Java based program which is platform independent.
Portable
Image takes less memory space.
Takes very less amount of time in conversion.
No effect on image quality and dimension.
Data stored in database is more secure.
Each images stored in database with unique ID.
If you need to convert one or thousands of images of varying types, this is the
tool.
A BMP image having size 5MB is converted to JPG image then it’s size reduced
up to 700 KB but image quality is unaffected.
Instead of storing the image, you can store the byte array of that image in DB. You
can convert that image to byte array & store in DB. Byte Array (Base 64 string)
which is more secure.
It can be used in various places like Banks, UIDAI (Aadhaar), photography etc.
CONCLUSION
THANK YOU