Base64 image uploading to Pasteros

Body

Pasteros now has JPEG handling abilities when pastes are uploaded with base64 data (see commit). Convert your image to base64 like this and view it by add .jpg to the end of the paste ! I also wrote a command line utility that uploads a selected screenshot area to Pasteros.

 

#!/bin/bash

function uploadImage {
 content=$(cat $1 | base64 -w 0)
 pasteid=$(curl -silent -H "Expect:" -X POST -d $content https://pasteros.io/api/v1/simplecreate | tail -1)
 echo "https://pasteros.io/$pasteid.jpg"  | xclip -selection c
}

DISPLAY=:0.0 scrot -s "shot.jpg" 
uploadImage "shot.jpg"
rm "shot.jpg"
notify-send "Done"

via https://pasteros.io/57aada0276bf8

Tags