A possible bug in Vegas.SaveSnapshot()

JohnnyRoy wrote on 3/28/2004, 5:31 AM
I think I’ve found a bug in Vegas.SaveSnapshot() API. If you change the Vegas.Project.Preview.RenderQuality and Vegas.Project.Preview.FullSize, then Vegas.SaveSnapshot will take a snapshot of the current cursor position regardless of what position you pass in as the third parameter. When you call it a second time it will honor the position passed in.

The following test case proves this. All three snapshots, test1.jpg, test2.jpg and test3.jpg should be the same frame with different quality and size, but test2.jpg will be the frame under the Vegas.Cursor! One would especially expect that the last two calls to SaveSnapshot would be the same image but they are not. (at least not on my PC) ;-) Make sure you move the cursor to a frame other that 00:00:01:00 before you run this so you can see the effect.

/** 
* Program: ASnapshotBug.js
* Description: This script shows that SaveSnapShot doesn't honor the position passed
* in if both the RenderQuality and Preview FullSize are changed. For this
* test case to work the Vegas Curor should not be at 00:00:01:00.
* Author: Johnny (Roy) Rofrano john_rofrano at hotmail dot com
*
* Date: March 27, 2004
**/

import System.Windows.Forms;
import SonicFoundry.Vegas;
var originalPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
var originalPreviewFillSize = Vegas.Project.Preview.FullSize;
try
{
// For this test the snap position is fixed so every
// snap should be the same frame!
var snapPosition : Timecode = new Timecode("00:00:01:00");
// take an initial snapshot as the control base
Vegas.SaveSnapshot("C:\\temp\\test1.jpg", ImageFileFormat.JPEG, snapPosition);
	// But if you set the preview quality and size, the very next snapshot
// will be of the current cursor position and NOT the snapPosition
Vegas.Project.Preview.RenderQuality = VideoRenderQuality.Best;
Vegas.Project.Preview.FullSize = true;
	// These two should be the same frame but theyr'e not!
Vegas.SaveSnapshot("C:\\temp\\test2.jpg", ImageFileFormat.JPEG, snapPosition);
Vegas.SaveSnapshot("C:\\temp\\test3.jpg", ImageFileFormat.JPEG, snapPosition);

}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Vegas.Project.Preview.RenderQuality = originalPreviewRenderQuality;
Vegas.Project.Preview.FullSize = originalPreviewFillSize;
/** End of program **/
See if you can reproduce this. Thanks,

~jr

Comments

JohnnyRoy wrote on 4/1/2004, 3:49 AM
> See if you can reproduce this

I kinda thought Sony would have acknowledged or denied this by now.

Would someone be kind enough to see if they can reproduce this on their PC or if its just my PC? I’m adding workaround code in my scripts and I want to be sure that this affects everyone. If it’s just me, I’ll reinstall and see if it clears up. Thanks in advance,

~jr
jetdv wrote on 4/1/2004, 5:56 AM
test1.jpg was from the 1 second mark

test2.jpg was from the cursor location

test3.jpg was from the 1 second mark

Does this help?
JohnnyRoy wrote on 4/1/2004, 7:07 AM
Yep, that proves my point. Thanks Ed.

~jr
SonyPJM wrote on 4/12/2004, 10:27 AM
Thanks for the bug report... I'll look into a fix.
JohnnyRoy wrote on 4/12/2004, 6:23 PM
You're welcome and thanks for looking into a fix. ;-)

~jr
SonyPJM wrote on 4/19/2004, 9:52 AM
This should be fixed in Vegas 5.0a
JohnnyRoy wrote on 4/19/2004, 4:06 PM
Confirmed. It works now. THANKS!

~jr