Comments

rmack350 wrote on 2/12/2008, 8:56 AM
Don't know the answer, but I'm looking. I'm sure this has been addressed in this forum but you can't search the forum right now. I wonder if you can force Google to search the forum?

Veggie Toolkit has a relinker tool in it.

The first thing I'd do is go rename the folder with the jpegs, or move the jpegs somewhere else. But that isn't going to easily get the PNGs into Vegas as replacements for the jpegs.

Cut/Paste in edit details?

Rob Mack
AlanC wrote on 2/12/2008, 9:19 AM
Did you just rename them or convert them to png?

If you converted them then I'm pretty sure if you rename all the extensions from png to jpg then upload them to the Media Pool, Vegas will replace all the jpg(jpg's) on the Timeline with the jpg(png's)

(You may not even need to upload them to the Media Pool again)
jrazz wrote on 2/12/2008, 9:55 AM
I converted them and resized them and placed them in a sub directory (so as to keep the originals and the mod'ed ones seperate).

I have already went through and replaced them one by one by using the media pool but I just assumed their would be an easier way.

j razz
johnmeyer wrote on 2/12/2008, 11:15 AM
The simplest thing, the next time you do this, is to move all the original files to some other folder. When you open the VEG file, Vegas will ask if you want to replace the first of the missing files. You select the option to replace, and point to the first of your replacement files which is in some other folder. If you have saved these files so they have the same name, Vegas should then say that it has found all the other replacement files, and do you want to use them. If it doesn't, close that project and rename the new files so they are identical -- including the extension -- to the original files. Then re-do the above. I realize that this means that you will have the wrong extension, but I don't think that will matter.


rmack350 wrote on 2/12/2008, 9:58 PM
Hmm. Rename a PNG file as a .JPG. I wouldn't have thought it would work but it looks like it does. Vegas will open a PNG file that's been misnamed as a jpg.

Hopefully it doesn't come back to haunt if there are hundreds of such files in a project.

Rob Mack
johnmeyer wrote on 2/12/2008, 10:23 PM
Rename a PNG file as a .JPG. I wouldn't have thought it would work but it looks like it does ...

File extensions are used by Windows to associate which program will open the file when it is double-clicked (much as Mac has always done). However, when a program opens a file it (should) look at the file header rather than the file extension to determine what the heck is inside. It would be amazingly poor programming practice to do otherwise because we users tend to do dumb things like name files incorrectly.

The extension is really just part of the file name and therefore it doesn't matter if you call the file Donald, Fred, or George -- or for that matter -- .PNG, .JPG or anything else.
rmack350 wrote on 2/12/2008, 10:44 PM
Not to throw stones but... I tried a misnamed png file in Paint, Windows Picture viewer, and IE. All of them opened the file except for IE.

I'm aware that programs should be looking at the header of the file but I wasn't optimist enough to think they really would.

Running the laptop with Windows tonight instead of Linux and there's not much installed that can open images. I don't use the windows partition much on this machine.

...The GIMP opens the misnamed file just fine too.

Rob
Rosebud wrote on 2/13/2008, 9:10 AM
I’m working on a script for this task.
If you are interested to test it, you can download a beta release HERE.
Please, since this script is a beta, make a copy of your project before to use it.

How to use:
Select media to replace in Mediapool and run script.
Select directory where the new media are located.
Select the extension of the new media (the base name of the new media must be the same as the media to replace).
Click “Search and Replace”.
jrazz wrote on 2/13/2008, 9:14 AM
Thanks Rosebud.

I will give it a try tomorrow when I am not working against a deadline.

Much appreciated.

j razz
logiquem wrote on 2/13/2008, 12:12 PM
Btw, don't forget the excellent Ckrename utility for batch renaming tasks...
Rosebud wrote on 2/18/2008, 3:26 PM
Hello jrazz,
Did you have time to have a look on my script ?
Thx
Gilles.
wwaag wrote on 2/18/2008, 3:54 PM
Gilles,

Not jrazz, but I have tried your script and found it to work very well. I've been using it to replace avi's from Deshaker with m2t's that have been batch-rendered. It really is a time-saver. My only suggestion (minor) would be to have an option to search the original file folder for replacements in addition to specifying the exact location, which the script now requires. In any case, it works well and I'm very pleased. Thanks for your effort.

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

jrazz wrote on 2/18/2008, 4:11 PM
Sorry for not getting back with you. Please don't take that as a slight. I am very appreciative of your work on this.

I just now tested your script and here is what I got on a Vista home premium machine. Would it make any difference running it on a Vista 64 Ultimate machine?

"An error occurred during execution of the script C:\Program Files\Sony\Vegas Pro 8.0\Script Menu\Batch Replace script\Batch_Replace.dll.

The located assembly's manifest definition does not match the assembly reference."

System.IO.FileLoadException: Could not load file or assembly 'Sony.Vegas, Version=8.0.0.179, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Sony.Vegas, Version=8.0.0.179, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc' ---> System.IO.FileLoadException: Could not load file or assembly 'Sony.Vegas, Version=8.0.0.217, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Sony.Vegas, Version=8.0.0.217, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc'


at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Signature..ctor(RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Reflection.RuntimeMethodInfo.get_Signature()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.RuntimeType.FilterApplyMethodBaseInfo(MethodBase methodBase, BindingFlags bindingFlags, CallingConventions callConv, Type[] argumentTypes)
at System.RuntimeType.GetMethodCandidates(String name, BindingFlags bindingAttr, CallingConventions callConv, Type[] types, Boolean allowPrefixLookup)
at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetMethod(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
at Sony.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
at Sony.Vegas.ScriptHost.PrecompiledScriptManager.Run()
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)

I unzipped the file and installed the entire folder in the script folder with my other scripts. I renamed the folder (took out the converted spaces and made them real spaces (i.e. Batch020%Replace020%, etc.)

From there I chose four png files in the project media (they are fireworks png files and contain metadata) and when I went to the script menu the above error is what I got.

j razz
Rosebud wrote on 2/18/2008, 10:16 PM
j razz,

I believe it’s a Vista compatibility issue (unfortunately, I don’t have this OS to test the script).
I will post in the Vegas-Scripting forum to have some info about that.
Thx for your tests.
Rosebud wrote on 2/19/2008, 9:42 AM
Please Jrazz, read this message.
Are you running V8.0b ?
jrazz wrote on 2/19/2008, 11:03 AM
I don't recall if I updated that pc or not. I will check once I get back to my office and update or report back that the issue is not the update.

j razz
jrazz wrote on 2/20/2008, 8:58 AM
I only had revision A on that pc. I will update and let you know how it goes.

j razz
Rosebud wrote on 2/23/2008, 2:19 PM
Wwaag,

Thx for your suggestion.
I added a checkbox to include subdirectories (so you don’t need to select precisely the folder). Press Escape to cancel search.
Same link to download.