Resize images in visual basic

V
Posted By
veerleverbr
Jul 6, 2004
Views
700
Replies
3
Status
Closed
Hi,

I have PhotoShop 7.0 installed. I would like to write a small visual basic program that opens some image files (bmp, tif or jpg), resizes them and then saves them as jpg, using the PhotoShopTypeLibrary. This way, I can quickly resize all my images for use on my website.

I already managed in my VB program to open PhotoShop, to open the image files and to play actions on the image files. This is not enough.

What I also need to be able to do is determine the width and height of the original image file, so that I can choose between the action that resizes to 640×480 and the action that resizes to 480×640.

The second problem is the SaveAs method. I only manage to use it to save the bitmaps in de psd format, but I would like to save them as jpg so that I can use them on my website.
Maybe here I can create a "SaveAsJpg" action that saves the file in the temp folder. Then my VB program would have to move the file to the correct folder and rename it? But that seems as quite a workaround…

Any ideas if it is possible to determine the width en height of an image file using the PhotoShopTypeLibrary?
Any ideas if saving the image as jpg can be done more easily then my workaround described above?

Veerle

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

EG
Eric Gill
Jul 6, 2004
(Veerle) wrote in
news::

Any ideas if saving the image as jpg can be done more easily then my workaround described above?

File->Automate->Web Photo Gallery. Makes thumbnails, too.

Pitch the HTML pages if you have no use for them, otherwise, you can work up a pretty good navigation system in a couple of mouse clicks.

If you want to hand-select a the files you want converted, open the Browser, indicate the ones you want and Automate->Web Photo Gallery.
B
Broga
Jul 7, 2004
Veerle" wrote in message

What I also need to be able to do is determine the width and height of
the original image file, so that I can choose between the action that resizes to 640×480 and the action that resizes to 480×640.

Did you know that you can add a column called ‘Dimensions’ to the Windows Explorer view ? (XP)

If you then click on the Dimensions tag at the top of the page it will arrange your images in terms of ascending/descending dimensions

I was wondering if you could use this feature to divide your pictures into the two sets required and then process them separately
V
veerleverbr
Jul 13, 2004
What I also need to be able to do is determine the width and height of
the original image file, so that I can choose between the action that resizes to 640×480 and the action that resizes to 480×640.

Did you know that you can add a column called ‘Dimensions’ to the Windows Explorer view ? (XP)

If you then click on the Dimensions tag at the top of the page it will arrange your images in terms of ascending/descending dimensions
I was wondering if you could use this feature to divide your pictures into the two sets required and then process them separately

I already found another and more easy way to retrieve the size of the original pictures in VB.NET:
Dim Pic As Image = Image.FromFile("c:\test.jpg") Dim PicWidth As Integer = Pic.Size.Width
Dim PicHeight As Integer = Pic.Size.Height

But it would be nice to find a way to resize my pics from within my VB.NET program using Photoshop without having to use actions. Isn’t there any other way?

Veerle

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Related Discussion Topics

Nice and short text about related topics in discussion sections