Skip to content

Instantly share code, notes, and snippets.

@iamsortiz
Last active May 25, 2016 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamsortiz/ac3fb22646294d8a33bd71ebc968f34a to your computer and use it in GitHub Desktop.
Save iamsortiz/ac3fb22646294d8a33bd71ebc968f34a to your computer and use it in GitHub Desktop.
Given some draw.io .png diagrams, generate jpg's for the original size, and for a smaller version JIRA embeded friendly
#!/bin/bash
# Given a folder structure
#
# * ./
# * ./raw
#
# With the draw.ioong exports at raw
#
# It will leave all your JIRA-embed-ready images at ./
#
# Recommendation: folder issueXX and drawio images as issueXX-whatever for better organization
find raw/*.png -printf "%f\n" | sed -e 's/\.[a-zA-Z0-9]*$//g' | xargs -n 1 -I {} bash -c 'convert raw/{}.png {}.jpg; convert raw/{}.png -resize 1200x1000\> {}_small.jpg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment