Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

automated image resizing of the contents of a windows folder

Posted on 2011-02-26
10
Medium Priority
?
244 Views
Last Modified: 2012-06-27
I have an Access application that imports student's info and a photo that they upload to a website.

This import is automated and the photos are imported into an Attachment field. I'd normally leave them external and just store the path but in this instance this is not practical.

As the file sizes will vary I want to be able to resize all the images to pasport image size before the import.

So what I need is a script or command line driven utility that can resize all of the images in a specified windows directory. I can then shell out to this utility from Access.
0
Comment
Question by:kentgorrell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 34990053
Why don't you limit the size on upload? If you only take photos on the web site of the proper size, you don't have to do any conversion on the Access side.
0
 

Author Comment

by:kentgorrell
ID: 34990091
That would make it harder for the client trying to join.

My job is to make things easier. Isn't that what software development should be all about?
0
 
LVL 40

Expert Comment

by:als315
ID: 34990403
You will need third party tool, like this:
http://download.cnet.com/Free-Batch-Image-Converter/3000-2084_4-10845423.html
You can run it from Access
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kentgorrell
ID: 34993700
Nice tool but currently no support for command line parameters.

I'd still like to find something that requires no user intervention.
0
 
LVL 40

Expert Comment

by:als315
ID: 34995000
As I have mentioned, there is a lot of such tools:
http://www.rw-designer.com/photo-resizer-advanced
with command line
0
 

Accepted Solution

by:
kentgorrell earned 0 total points
ID: 35160926
In the process of testing applications.
Found one that doesn't cost much and does the job but because it isn't free I can't include it in my installer which makes distribution (even though it's just a few clients) difficult.
So I just need time to try out Advanced Photo resizer
I'll post back after further testing.
0
 
LVL 15

Assisted Solution

by:Giovanni Heward
Giovanni Heward earned 2000 total points
ID: 36319876
0
 
LVL 15

Expert Comment

by:Giovanni Heward
ID: 36319926
Here is a script I wrote for a previous project... as-is it reduces the image size to 80%, however you can change the command-line to resize by pixels (for example):

convert -size 525x375 "%%f" "%%f"

Other tweaks will may be needed (various image extensions, for example)

Good luck...



@echo off
:: install http://www.imagemagick.org/download/binaries/ImageMagick-6.7.1-2-Q16-windows-dll.exe
setlocal enabledelayedexpansion
set log="%userprofile%\desktop\output.txt"
call :logit JPEG Compression Script 1.0a by Giovanni Heward started %date% %time%
if not exist "%programfiles%\ImageMagick-6.7.1-2-Q16\convert.exe" (
	call :logit "%programfiles%\ImageMagick-6.7.1-2-Q16\convert.exe" not found, aborting...
	goto :eof
)
if [%1]==[] (set minsize=100000) else (set minsize=%1)

for /f "delims=?" %%f in ('dir *.jpg /s/b') do (
	set bits=%%~zf
	if %%~zf leq !minsize! (
		call :logit Not compressing %%f, less than !minsize! bits ^(!bits!^) 
	) else (
		call :logit Compressing %%f, greater than !minsize! bits ^(!bits!^)
		"%programfiles%\ImageMagick-6.7.1-2-Q16\convert.exe" -compress JPEG -quality 80 "%%f" "%%f"
	)
)
call :logit JPEG Compression Script 1.0a by Giovanni Heward ended %date% %time%
goto :eof

:logit
echo %*&title %*&echo %*>>!log!

Open in new window

0
 

Author Comment

by:kentgorrell
ID: 36320044
This looks good, don't have time to test it all at the moment but, being open source it allows me to distribute it with my application. And that is my main concern in most cases.

So thank you and I'll get back with a comment once I've had a chance to try it out.
0
 

Author Closing Comment

by:kentgorrell
ID: 36367953
Haven't tested yet but it looks like what I need.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question