Skip to main content

Determine the height and width of an image

Comments

3 comments

  • Franco Di Bari

    I have just found the solution myself.
    With a server workflow via “Get Image Metadata Activity” you can get the height and width.

    …but regardless, does anyone know how to create an object in javascript if the client workflow doesn't allow it (var img = new Image ())?

     

    0
  • Ken Lyon

    Hi Franco Di Bari ,

    Thanks for your question. As you discovered, it's not possible to create certain types of JavaScript objects through workflow expressions. There are a few reasons for this.

    First of all, for security reasons we took the precaution early on of only allowing a “whitelist” of trusted types and functions to be used. This has increased over time and will increase in future to include other types.

    The other reason for limitations is that we want to ensure that everything that the workflow designer suggests to you in the expression editor works in both TypeScript and .NET, so that you can have a workflow that works in Web and also Mobile.

    In order to support the Image constructor, we would need to be able to satisfy both of these criteria. I think the security concern is probably not an issue, but it might need a bit of work to translate to .NET. There is an equivalent class there, but the properties and methods may differ.

    0
  • Franco Di Bari

    Hello Ken,

    Thank you for the information. Now I understand the reason better. It would make things easier sometimes, but I do understand that sometimes there are constraints that need to be met.

    0

Please sign in to leave a comment.