Copy link to clipboard
Copied
Hi
I have to deliver thumbnails along with SWFs to an asset management tool.
Using Adobe Bridge (CS4) I can see previews of selected SWF files but can't see how to export them.
I tried the BridgeExportToJpegCS4 extension which works well for images but got an error for an SWF test file I have.
"Error: Could not obtain a valid bitmap to export."
I'm not sure I'm using the correct application but open to other suggestions.
Any ideas?
Also, I'd appreciate if there are any suggestion on how to extract the thumbnails and XMP metadata programmatically.
I'm a java developer and hoping I could automate this process for users through an SDK or by calling a utility.
Regards,
Carmine
From a quick google search I found this...
http://www.eltima.com/products/swf-live-preview/
It looks as this might be able to create thumbnails.
Copy link to clipboard
Copied
See http://forums.adobe.com/thread/852571?tstart=30 for an idea of sizes available.
Here is an example of getting a thumbnail and saving it on the desktop....
#target bridge
var thumb = app.document.selections[0];
var sourceBitmap = undefined;
app.synchronousMode = true;
sourceBitmap = thumb.core.thumbnail.thumbnail; //smallest
//sourceBitmap = thumb.core.preview.preview; //next size
app.synchronousMode = false;
if( !sourceBitmap || sourceBitmap.width == undefined || sourceBitmap.width == 0 ){
alert("Unable to get bitmap");
}else{
var Name = decodeURI(thumb.spec.name).replace(/\.[^\.]+$/, '');
var exportFile = new File( Folder.desktop + "/" + Name + "-thumb.jpg" );
sourceBitmap.exportTo( exportFile, 100);
}
There are many examples of extracting metadata and it might be best to look at some of them, also download the sdk where you will find all the documentation and examples.
http://www.adobe.com/devnet/bridge.html
If it looks a bit complex you could use ExifTool http://www.sno.phy.queensu.ca/~phil/exiftool/ as an alternative.
Copy link to clipboard
Copied
Hi Paul
Thanks for the snippet. Except for the menu item addition, I added it as is to Bridge but got the alert error.
"Unable to get bitmap"
I also tried to comment out the thumbnail code and uncomment the preview but still no good.
I'll try to break up the if tests to see if I can nail down if there is no bitmap or if the width is 0;
Other suggestions?
Regards
Carmine
Copy link to clipboard
Copied
I would try ExifTool and see if that can extract a thumbnail
exiftool -b -ThumbnailImage MyPhoto.swf>MyThumb.jpg
If Exiftool can't extract a thumbnail, one doesn't exist.
Apart from this I'm out of suggestions as I don't use this type of file.
All the very best Carmine and good luck with the project.
Copy link to clipboard
Copied
For a baseline, I used exiftool on a jpg file and it worked but on my swf it created a 0 byte file.
I guess a thumbnail doesn't exist for the files we have which changes the quest to see if a thumbnail can even be expected from swf.
Many Thanks for the help.
Copy link to clipboard
Copied
From a quick google search I found this...
http://www.eltima.com/products/swf-live-preview/
It looks as this might be able to create thumbnails.
Copy link to clipboard
Copied
Now that worked liked a charm. The tool is a little short on an interface but it works great and its free.
It appears as if swf-live embeds a thumbnail into the swf. Then I used your script to export the thumbnail from bridge without error.
Thanks again Paul.