Jump to content

Recommended Posts

Posted

Does anyone know of any Freeware that will let me drag into it a selection of photoshop files and convert them to JPEG AND save them back to the original folder?

 

I've tried Paint Shop Pro, IrfanView and Photoshop but none of these will convert the files to JPEG and save them in the folder the original PSD file was found in.

 

There's about 2 thousand files that I need to convert and there's no way i'm doing it by hand!

Posted

Does the IrfanView option "Use this directory for output" not work, or are all your PSD files in different folders?

 

You could use the ImageMagick command line version which I think should do the job.

Posted
Does the IrfanView option "Use this directory for output" not work, or are all your PSD files in different folders?

 

All the files are in different folders. Basically I want to convert all the 50MB+ PSD files in the users folders to smaller JPGs

Posted

Beware this script will act on all files found of that type in its path. You will need to install image magick as well. This scipt can be adapted easily for other uses as well and no laughing at all the quotes! I know there are other ways to escape the quotes but thats just what I came up with at the time ;) .

 

I used this to covert all the crappy bitmap images to jpegs in our user home directories.

 

'WMI Script to find certain file types and run a command on them
'Chris Hindmarch FisherMore R.C High
'I take no responsibility if this script messes anything up 
' Use with extreme caution as it will act on **ALL** the files of the
' defined file type in the path

strComputer = "."
Path = "E:\Home\FMStudent" 'Path to the root of the directory to search recursively
OutPath = ""
OutputFormat = "jpg"
Drive =""
FilePath= ""
FileSize = 0
StrCmdLine = ""
Ext = "bmp" ' Set the filetype you are looking for ommit the "."

Set ObjShell = CreateObject("WScript.Shell")

' Replace back slashes with double back slashes else an error will occur
Path = Replace(Path,"\","\\")
FilePath = LCase(Path)'Convert to lower case as wmi ouputs in lower case

'Get drive letter
Drive = Left(FilePath,2)
WScript.echo "Drive= " & Drive

'Get the rest of the path
FilePath=Right(FilePath,(Len(FilePath) -2))

'Create the like query string 
FilePath = "%" & FilePath & "%"

Set objWMIService = GetObject("winmgmts:" _
   & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
   
Set colFiles = objWMIService.ExecQuery _
   ("Select Drive,Path,Extension,FileSize,FileName from CIM_DataFile where Extension = '" & ext &_ 
   "' and Drive = '" & Drive & "' and Path Like '" & FilePath & "'")
   
WScript.echo "The Parent File Path = " & FilePath 
'Wscript.echo "The amount of files found was " & colfiles.count

If ColFiles.Count >= 1 Then
For Each objFile In colFiles
  'Get the full file path
CombinedPath = objFile.drive & objFile.Path & objFile.FileName & "." & objFile.Extension
WScript.Echo "THe Combined Path = " & CombinedPath
'Alter File path to reflect new file type
OutPath = Replace(CombinedPath,Ext,OutputFormat)

'WScript.echo objFile.drive & objFile.Path & objFile.FileName & "." & objFile.Extension
FileSize = FileSize + objFile.FileSize

StrCMDLine = "c:\imagemagick\convert.exe " & """" & CombinedPath & """" & " " & """" & OutPath & """"
  WScript.Echo StrCMDLine
  ObjShell.Run StrCmdLine,1,True

'End IF


Next
Else

WScript.echo "No Files Found or incorrect path specified"

End If 'IF ColFiles.Count >= 1 Then
FileSize = FileSize/1024
WScript.echo "Disk Space in KiloBytes= " & FileSize & VbCrLf

FileSize = FileSize/1024
WScript.echo "Disk Space in Meg= " & FileSize & VbCrLf

FileSize = FileSize/1024
WScript.echo "Disk Space in Gigs= " & FileSize & VbCrLf

Posted

Imagemagik suite is the muttses nuttses - you can do a hell of a lot with it - writing text on images, cropping, etc. etc.

 

I also recommend "jhead" (I know it sounds like it should be filtered.. it ain't! ;)) http://www.sentex.net/~mwandel/jhead/

this has an "autorot" option that will rotate digicam pics if your camera writes the correct exif. Can also be used to sort by time - especially useful for merging 2 photosets from 2 cameras of the same occasion.

Posted

I tell a lie, when I went back to the server this message came up:

 

Script: c:\BMP2JPG.vbs

Line: 43

Char: 1

Error: The remote procedure call failed

Code: 800706BE

Source: SWbemObjectSet

 

And line 43 is: If ColFiles.Count >= 1 Then

Posted

Must be my error trapping (or lack of) it musnt be finding what you have put it as extensions.

 

Uncomment the line above and see if it is finding the files.

Posted

What exactly should I have to change?

 

I've changed the path to the path I want "E:\Users\Pupils\"

 

I've kept OutputFormat as jpg and Ext as bmp as i'm doing bmp's first then i'll go on to Photoshop files.

 

I've also changed StrCMDLine to where my convert.exe is located.

Posted

The only thing I can think of is there is there is a problem with the way the WMI query has wrapped

 

Set colFiles = objWMIService.ExecQuery _
   ("Select Drive,Path,Extension,FileSize,FileName from CIM_DataFile where Extension = '" & ext &_ 
   "' and Drive = '" & Drive & "' and Path Like '" & FilePath & "'")

 

At the end of the lines get rid of the "_" make alll those 4 lines into 1. Im out for the afternoon will check back later.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...