Task C: Uploading Pictures
Since we’re creating a new workflow, we should create a new namespace for it. Let’s make a picture-gallery.routes.upload namespace for handling this task.
The workflow requires a form to facilitate the upload. Once a file is submitted via this form, we’ll need to create a thumbnail to display when listing the user gallery.
The functionality for scaling images can be found in the java.awt.geom package provided by the Java standard library. In this section, we’ll use Java interop to wrap it in idiomatic Clojure functions for use in our application.
Let’s start by adding all the required references to our namespace. It looks like a lot, but some of them should be familiar. We’ll cover how the other ones are used ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access