Message Boards Message Boards

1
|
4340 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Newbie - How do I set up a form so that it has an image upload?

Posted 10 years ago
POSTED BY: s a
3 Replies
Posted 10 years ago

Also see this for a full example using APIFunction

http://community.wolfram.com/groups/-/m/t/537621

POSTED BY: Stephen Coast

It's hard to point at a specific piece of documentation to solve our problem. Here's the code you're looking for:

CloudDeploy[
 FormFunction[{"size" -> "Number", "image" -> "Image"}, 
  ImageResize[#image, #size] &, "GIF"]]

You can change the size of an image using the ImageResize function. To find that, you shave to search the documentation and learn a bit about how image processing works in Mathematica.

"Number" and "Image" are "Interpreter types". See the documentation of Interpreter for more examples. These "Interpreter Types" can be used as inputs to a form function. There are many of them.

POSTED BY: Sean Clarke
Posted 10 years ago

Thank you, that is very helpful, I have tried it with the new ImageIdentify function -

CloudDeploy[
    FormFunction[{"image" -> "Image"},
        ImageIdentify[#image]&,"PNG"]] 

It works, it is pretty cool. I then tried switching it to an API, which also worked. thanks for the help.

POSTED BY: s a
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract