Skip to content

Instantly share code, notes, and snippets.

@emceeaich
Forked from vadimkantorov/image2urijpeg.sh
Created March 10, 2023 20:39
Show Gist options
  • Save emceeaich/3bf58c3ecdad79c3b93eaa587bab972d to your computer and use it in GitHub Desktop.
Save emceeaich/3bf58c3ecdad79c3b93eaa587bab972d to your computer and use it in GitHub Desktop.

Revisions

  1. @vadimkantorov vadimkantorov revised this gist Apr 19, 2018. 2 changed files with 5 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions image2jpeguri.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +0,0 @@
    # Usage:
    # bash image2urijpeg.sh image.jpg 320x240 > base64.txt # will resize before conversion
    # bash image2urijpeg.sh image.jpg > base64.txt # will keep original size

    magick "$1" -resize ${2:--} jpeg:- | openssl enc -base64 -A | sed -e 's/^/data:image\/jpeg;base64,/'
    5 changes: 5 additions & 0 deletions image2urijpeg.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Usage:
    # bash image2urijpeg.sh image.jpg 320x240 > base64.txt # will resize before conversion
    # bash image2urijpeg.sh image.jpg > base64.txt # will keep original size

    magick "$1" -resize ${2:--} jpeg:- | openssl enc -base64 -A | sed -e 's/^/data:image\/jpeg;base64,/'
  2. @vadimkantorov vadimkantorov created this gist Apr 19, 2018.
    5 changes: 5 additions & 0 deletions image2jpeguri.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Usage:
    # bash image2urijpeg.sh image.jpg 320x240 > base64.txt # will resize before conversion
    # bash image2urijpeg.sh image.jpg > base64.txt # will keep original size

    magick "$1" -resize ${2:--} jpeg:- | openssl enc -base64 -A | sed -e 's/^/data:image\/jpeg;base64,/'