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](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/1.jpg)
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.
![Page 2: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/2.jpg)
Introduction
System and Software Required
Working
Advantages
Applications
CONTENTS
![Page 3: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/3.jpg)
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.
![Page 4: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/4.jpg)
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
![Page 5: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/5.jpg)
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
![Page 6: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/6.jpg)
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.
![Page 7: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/7.jpg)
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 :
![Page 8: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/8.jpg)
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.
![Page 9: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/9.jpg)
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.
![Page 10: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/10.jpg)
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).
![Page 11: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/11.jpg)
Disruption of Obstruction During
Image Conversion
If old path and/or new path are not provided then an error message will be
generated.
![Page 12: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/12.jpg)
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.
![Page 13: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/13.jpg)
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.
![Page 14: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/14.jpg)
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
![Page 15: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/15.jpg)
Disruption of Obstruction During
Saving of Images in Database
If New Path is not provided then an error message will be generated.
![Page 16: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/16.jpg)
Continued……. If program is not successfully connected to database due to invalid user,
password, driver, etc. then an error message will be generated.
![Page 17: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/17.jpg)
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.
![Page 18: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/18.jpg)
Disruption of Obstruction During
Upload of Images From Database
If Old Path is not provided then an error message will be generated.
![Page 19: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/19.jpg)
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.
![Page 20: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/20.jpg)
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.
![Page 21: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/21.jpg)
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
![Page 22: Image Converter](https://reader033.vdocument.in/reader033/viewer/2022052316/5597f0851a28ab92758b460e/html5/thumbnails/22.jpg)
THANK YOU