Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Using the Blitline pre_process tag

No description
by

Blitline Developer

on 28 February 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Using the Blitline pre_process tag

Multiple Image Processing with a Blitline Job What do I do if I need to wait for 1 Blitline job to process before I can start another? Example: I have a mask that is 640x480px I want to resize that mask to 320x240px, and apply it to my image Previously, this would have take 2 Blitline jobs, one to resize the mask image, then once resized, there would have to be another job to composite it on to the image... Introducing the "pre_process" tag Pre-processing allow you to perform multiple jobs BEFORE the primary job is run. This provides you a way to make sure some images are processed BEFORE other images. Job Job Job Primary job waits for Job 1, Job 2, and Job 3 to complete before starting Also... The primary job can use the results
of the pre_processed jobs So you can process images, then do stuff like overlay them on to your image, or append them into something like a filmstrip How do I use
"pre_process" jobs? They look just like regular Blitline jobs. {
"src":"http://cdn.blitline.com/filters/boys.jpeg",
"functions":[
{
"name":"resize_to_fit",
"params":{
"width":100
},
"save":{
"image_identifier":"MY_CLIENT_ID"
}
}
]
} "pre_process" : {
"jobs" : [












]
} Wrapped in a pre_process tag "MY_CLIENT_ID" Now, future functions can reference this image by setting their "src" equal to "&" + image_identifier. So in this case, future functions can use this image by setting

"src" : "&MY_CLIENT_ID" Example {
"application_id":"XVBsG4FNFO5eIJkyEyzHgw",
"src":"https://s3.amazonaws.com/bltemp/boys640.jpg",
"pre_process":[
{
"job":{
"src":"https://s3.amazonaws.com/img.blitline/mask3.png",
"functions":[
{
"name":"rotate",
"params":{ "amount":25 },
"functions":[
{
"name":"resize_to_fit",
"params":{ "width":640 },
"save":{ "image_identifier":"MY_CLIENT_ID"}
}
]
}
]
}
}
],
"functions":[
{
"name":"composite",
"params":{
"gravity":"CenterGravity",
"src":"&MY_CLIENT_ID",
"composite_op":"CopyOpacityCompositeOp",
"as_mask":"true"
},
"save":{
"s3_destination":{
"bucket":"bltemp",
"key":"grumpy_squirrel/out/simian_7.png"
},
"image_identifier":"foo2"
}
}
]
} Blitline Job JSON Example Now you have resized an mask ...and then overlayed it on to your image, all in a single synchronous Blitline job.
Full transcript