Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA and images question (2002)

    I have an Access database that uses photos (jpeg) in several reports, there are approximately 336k images at around 90k each stored on a local disk. Is there a way that I can use VBA to somehow save the image at a reduced file size? If I lose a little of the image quality no big deal, I just need to reduce the amount of disk space required to store the images. I read that you can use desktop publishing software to optimize images for the web, which would most likely meet my needs. However, I'd like to be able to loop through all the images in a VBA routine and do something similiar. Any help would be greatly appreciated.

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA and images question (2002)

    AFAIK, there is no way to accomplish that task using standard Access tools. I had a similar requirement for an application at my office, and I purchased two ActiveX controls for the program. About $USD60 each, IIRC. The first ActiveX was a thumbnail manager (sounds like you don't need that, though) and the second was an image control. With the image control, I can open the original image and save a copy in a new resolution. Some VBA programming was required.

    Access MVP Tony Toews has a nice list of image controls on his site. http://www.granite.ab.ca/access/imagehandling.htm The one that I used is on the list. Its URL is http://www.viscomsoft.com/imageviewer.htm

    An alternative would be to resize the JPGs outside your application. Irfranview (free) can do that in a batch mode. irfranview.com

    Finally, do you *really* need to resize the images? 33 MB is not that much disk space, and 90 kb files should be relatively quick to handle.
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: VBA and images question (2002)

    There are some imaging software and ActiveX controls that come with Windows. With Windows 98 it was the Kodak Imaging. For XP, it is different, and I think it was a free download from Microsoft.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA and images question (2002)

    Thanks for the repsonse, I appreciate the options. I don't absolutely have to resize the images, but I think it would be worth the effort as long as it's not a monumental task. This is a read-only database that gets refreshed periodically, the smaller I can keep the mdb and images the easier it is to distribute.

    I'll check out the controls. Thanks again.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA and images question (2002)

    Uh oh.... I interpretted from your first message that the database stored only the pathname to the JPGs and that the images remained in their native format on-disk. From your latest message, it sounds like you are storing the images inside the database itself. That is generally regarded as poor practice because of database bloat. I recommend that you visit Tony Toews site as mentioned in my previous post. Also look at http://members.tripod.com/accdevel/imaging.htm
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •