Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Simple REST upload that accepts a jpeg file and convert it to heic format.

Writing REST in go is surprisingly simple. The upload part is almost entirely based on

The conversion part is taken from and this is written by Ben Gotow (

StackOverflow is very handy when I need help writing json at

Example converting file to heic format using curl. Open a Terminal window and copy and paste the command below, change the filename after the @-sign.

curl -OLJs -F "file=@_7D_8286.JPG" ""

If the file is located in the Pictures-folder and is called IMG_0906.JPG the command is

curl -OLJs -F "file=@Pictures/IMG_0906.JPG" ""

If you have more than one file the following loop works (in bash and zsh):

for f in *.jpg; do
  echo ${f}
  curl -OLJs -F "file=@${f}" ""

O tells curl to download the file, otherwise it will just display it at the command line.
L tells curl to follow redirects.
J tells curl to save the file using the remote header name.
s tells curl to be silent.
F tells curl what file you want to upload.

Give it a minute or two after the file have been uploaded. When it is uploaded and converted a http redirect 303 GET's the converted file with the same name as the original but with the heic extension.

The converter also handles png-files.

If you find it usefull a tiny donation can be made to the following litecon address MBqiqTdjCcMsvdnxi7dKHiVcwWtWLKJvLo to cover the cost of running the smallest server (droplet) at Digital Ocean. And keep it small!


Simple REST upload that accepts a jpeg file and convert it to heic format.




No releases published


No packages published