Skip to content

Instantly share code, notes, and snippets.

@willnet
Created March 27, 2015 11:59
Show Gist options
  • Save willnet/ebc6cb9682a250e31f04 to your computer and use it in GitHub Desktop.
Save willnet/ebc6cb9682a250e31f04 to your computer and use it in GitHub Desktop.
create image whose file size you can specify for test
#
# brew install imagemagick exiftool
#
system('convert -size 128x128 xc:blue test.jpg')
file_size = 1_048_576 - 448
ascii = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
File.open('random.txt', 'w') do |file|
file.write(file_size.times.map { ascii.sample }.join)
end
puts `exiftool test.jpg -comment\\<=random.txt`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment