Created
March 26, 2012 17:46
-
-
Save kitschpatrol/2207459 to your computer and use it in GitHub Desktop.
Adding Tags to the Processing Flickr Uploader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void mousePressed() { | |
| // Upload the current camera frame. | |
| println("Uploading"); | |
| // First compress it as a jpeg. | |
| byte[] compressedImage = compressImage(cam); | |
| // Create an ArrayList (which implements Collection) to hold tags | |
| ArrayList tags = new ArrayList(); | |
| // Add as many tags as you like to the tags ArrayList | |
| tags.add("cosmic"); | |
| tags.add("manifold"); | |
| // Set some meta data. | |
| UploadMetaData uploadMetaData = new UploadMetaData(); | |
| uploadMetaData.setTitle("Frame " + frameCount + " Uploaded from Processing"); | |
| uploadMetaData.setTags(tags); // Pass in the tags! | |
| uploadMetaData.setDescription("To find out how, go to http://frontiernerds.com/upload-to-flickr-from-processing"); | |
| uploadMetaData.setPublicFlag(true); | |
| // Finally, upload/ | |
| try { | |
| uploader.upload(compressedImage, uploadMetaData); | |
| } | |
| catch (Exception e) { | |
| println("Upload failed"); | |
| } | |
| println("Finished uploading"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment