Feature #70

Add an option to get a base-64 encoded image from Weave through JavaScript

Added by Andy Dufilie over 5 years ago. Updated over 5 years ago.

Status:ResolvedStart date:07/20/2011
Priority:ImmediateDue date:
Assignee:Kyle Monico% Done:

100%

Category:JavaScript Interface
Target version:1.0
Complexity:Low OIC Priority:
Required by:MAPC, Boston, MA

Subtasks


Related issues

Related to Weave - Feature #350: Visualization Thumbnail Servlet Rejected 08/09/2011
Related to Weave - Feature #508: Create a servlet that accepts an image upload and provides a URL to download the image. Resolved 09/26/2011 10/10/2011
Blocked by Weave - Feature #82: Provide a way to call any function of any object from the JavaScript interface Resolved 06/30/2011

History

#1 Updated by Andy Dufilie over 5 years ago

  • Status changed from Open to Awaiting Feedback

Not sure if this is possible. Needs clarification on exactly what is needed. Do you want the actual bytes of the image? Do you want to print it? Save it to a file?

#2 Updated by Andy Dufilie over 5 years ago

Would it be sufficient to provide a function (accessible through JavaScript) that returns a binary image encoded in base 64? That would avoid additional server configuration and server code dependencies.

#3 Updated by Andy Dufilie over 5 years ago

  • Subject changed from Add an option to get an image from Weave through JavaScript to Add an option to get a base-64 encoded image from Weave through JavaScript
  • Status changed from Awaiting Feedback to Open

#4 Updated by Andy Dufilie over 5 years ago

  • Complexity set to Low

#5 Updated by admin account over 5 years ago

  • Complexity changed from Low to * Low *

#6 Updated by admin account over 5 years ago

  • Complexity changed from * Low * to Low

#7 Updated by Andy Dufilie over 5 years ago

  • Required by set to Grand Rapids, Michigan

#8 Updated by Andy Dufilie over 5 years ago

  • Required by changed from Grand Rapids, Michigan to Boston

#9 Updated by Kyle Monico over 5 years ago

  • Status changed from Open to In Progress
  • Assignee set to Kyle Monico
  • Required by changed from Boston to MAPC, Boston, MA

Example usage through the Javascript interface:

weave.evaluateExpression(null, 'getBase64Image(Application.application)', null, ['weave.utils.BitmapUtils', 'mx.core.Application'])

This is using the evaluateExpression function from the latest nightly build. If you want to get the image of a specific tool, you can do something like this:

weave.evaluateExpression(['SPT'], 'getBase64Image(this)', null, ['weave.utils.BitmapUtils'])

You can also use ['weave.utils::BitmapUtils'] for the qualified class name.

#10 Updated by Kyle Monico over 5 years ago

  • Status changed from In Progress to Resolved

#11 Updated by Christian Spanring over 5 years ago

this works great!

one question: can you exclude the menubar when creating the base64 representation? it's not really needed in a thumbnail and the "export" function also hides it. should I add a new feature request for that or can we just amend this ticket here?

#12 Updated by Andy Dufilie over 5 years ago

If you don't want the menu bar, use Application.application.visDesktop.

weave.evaluateExpression(null, 'getBase64Image(Application.application.visDesktop)', null, ['weave.utils.BitmapUtils', 'mx.core.Application'])

#13 Updated by Christian Spanring over 5 years ago

renders a transparent background, that's excellent, thanks!

#14 Updated by Andy Dufilie over 5 years ago

  • Target version set to 1.0

Also available in: Atom PDF