Our great sponsors
-
uuid
Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services. (by google)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
postman-app-support
Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
For image processing, I will use the bimg library because in my opinion it has a very intuitive API and is easy to use, in addition to being very fast.
Another library I'm going to use is google/uuid, because I'm going to want to rename the image that we uploaded, in order to ensure that its name is unique.
Now when we test our API using a tool similar to Postman you should get a result similar to this:
However, this article has only one prerequisite, which is the installation of libvips, otherwise it will not be possible to process the images. If you happen to have Homebrew installed on your computer, the process is simpler.
The framework I chose to create today's Api was Fiber, if you're used to working with Express, Koa or Fastify you'll feel at home.
However, this article has only one prerequisite, which is the installation of libvips, otherwise it will not be possible to process the images. If you happen to have Homebrew installed on your computer, the process is simpler.