PDA

View Full Version : JPG file re-sizing with VBA



Yulig42
09-21-2015, 02:56 AM
Hi all,

I've spent days on this problem already without any solution in sight.

I have an access DB that stores file names of jpg files stored in a specific folder. I have a continues form that displays those files (in an image control). The problem is that the files are very large (and I need them to stay large) which makes the form load very very slowly at best alternatively it does not load at all, or refresh a number of times on each page load.

To solve the above mentioned problem I've added a function that copies the original full sized file to the specific folder and alongside creates a small file (thumbnail size) in a folder next to the folder with the original files. The continues form then displays the small sized files and has a button to open up a the original size file.

I've searched high and low to find a solution within windows shell or just simply VBA but to no avail. The only thing I found was the ImageMagickObject.dll, which is great by itself but I really wanted to avoid external installations.

And, as I've found out, for a good reason. The installation worked in 30% percent of the cases. Some computers it works on and some it does not. A problem I was trying to avoid, and partly the reason I've chosen to build the DB in access.

I am looking desperately for a solution to re-size the JPG files with simple shell functions or built in VBA functions. Or any other solution that would not be environment dependent.

Any suggestion will be highly appreciated. I want to stress that I do not require the full functionality of JPG manipulations just to re-size a JPG file found on the disk to a specific and predetermined size.

Thank you!!

Also, if you've reached this far, the DB seems to function properly on access 2013 and 2010 (originally designed on access 2013), but access 2007 does not seem to like the VBA project, saying that it cant read it and saying that the only way to continue is to delete the project. Any help on this matter would also be highly appreciated. Must admit, I haven't put in the proper time yet to research the issue, but maybe you could save me that time as well:).

Thank you!

Yuli.

SamT
09-21-2015, 04:38 PM
To solve the above mentioned problem I've added a function that copies the original full sized file to the specific folder and alongside creates a small file (thumbnail size) in a folder next to the folder with the original files. The continues form then displays the small sized files and has a button to open up a the original size file.
If that solved the problem, what is the problem?


I am looking desperately for a solution to re-size the JPG files with simple shell functions or built in VBA functions. Or any other solution that would not be environment dependent.

I believe that IrfanView (http://www.irfanview.com/) can use a command line (shell) interface.