programatically convert tiff files to jpg

P

PaulB50

ok, I have an application written in access 2000 that imports & displays tiff
files in forms & reports. Having just received my new notebook & access 2007
the same application after conversion tells me that the tiff files are too
large, convert them to jpg - rack off.

I figured that the easiest option was to open the tiff files in mspaint then
saveas jpg's - ok that works. The trouble is I have thousands of these to
convert.

Question: How do I programatically open paint, open each tiff file & save it
out to another destination. I cannot find reference anywhere to mspaints
procedures & methods. I was looking to setup a function in msacces basic to
achieve this.

Can anyone help?

regards
 
B

Brendan Reynolds

PaulB50 said:
ok, I have an application written in access 2000 that imports & displays
tiff
files in forms & reports. Having just received my new notebook & access
2007
the same application after conversion tells me that the tiff files are too
large, convert them to jpg - rack off.

I figured that the easiest option was to open the tiff files in mspaint
then
saveas jpg's - ok that works. The trouble is I have thousands of these to
convert.

Question: How do I programatically open paint, open each tiff file & save
it
out to another destination. I cannot find reference anywhere to mspaints
procedures & methods. I was looking to setup a function in msacces basic
to
achieve this.

Can anyone help?

regards


Many graphics programs have this kind of batch-processing functionality
built in - you select your images, choose what you want to do with them, and
the program goes off and does it for you. Try http://www.photofiltre.com/
(free for non-commercial use and inexpensive for commercial use) or
http://www.gimp.org/ (open source, full-featured and powerful but more
complex and with a UI that is less familiar to Windows users). I use them
both - PhotoFiltre when I want to get something simple done quickly, GIMP
when I need to do something more complex. I haven't personally had a need to
batch convert TIFF files to JPEG format, so I can't promise, but I think
that PhotoFiltre can probably do this for you.
 
D

dymondjack

I wouldn't have the slightest clue how to go about this with vba, but a quick
search on "converting multiple images" returns a number of links for
applications to do this.

http://www.vcsoftwares.com/ImRe.html

There's one that I picked out of the list. Apparently you can use it to
select multiple files to resize and/or convert to a different format (tiff
and jpg are supported).

I haven't tried it, but I would think something like this may be a little
easier.
--
Jack Leach
www.tristatemachine.com

- "A designer knows he has reached perfection not when there is nothing left
to add, but when there is nothing left to take away." - Antoine De Saint
Exupery
 
4

4110

Hi,

I am not one of the resident experts or a professional programmer but I have
a database for my pictures and have a routine that does what you want to do.
I have a form that allows me to convert pictures of various types like tif to
jpg. The key is a tool called Image Magic. As I recall it is a free
download. The form has a text box for the source folder and another text box
for the destination folder. Both boxes have a button to display dialog box
to select the folder or you can cut and paste. There is a drop down list
with possible resolutions. There is also a text box that displays the
current file being processed to help track progress. Here is some key code:

Dim fs, f
Dim img
Dim files

'set script
Set fs = CreateObject("scripting.FileSystemObject")

'This routine uses the publicly available Image Magic to create the
thumbnails. (see www.imagemagick.org)
'This statement instantantiate the ImageMagick COM+ object
Set img = CreateObject("ImageMagickObject.MagickImage.1")

'get the file in the folder and store in collection files
Set files = fs.getfolder(PathToCamera).files

'use Image Magik to create a thumbnail size jpg file
img.convert PathToCamera & OriginalFileName, "-resize",
strResolution, PathToThumbnail & NewFileName


There is other code that sets up things including the variables in this code
segment but I think the variable names are self explanatory.

Good luck!
 
P

PaulB50

Thanks one & all

Brendan Reynolds said:
Many graphics programs have this kind of batch-processing functionality
built in - you select your images, choose what you want to do with them, and
the program goes off and does it for you. Try http://www.photofiltre.com/
(free for non-commercial use and inexpensive for commercial use) or
http://www.gimp.org/ (open source, full-featured and powerful but more
complex and with a UI that is less familiar to Windows users). I use them
both - PhotoFiltre when I want to get something simple done quickly, GIMP
when I need to do something more complex. I haven't personally had a need to
batch convert TIFF files to JPEG format, so I can't promise, but I think
that PhotoFiltre can probably do this for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top