Created
March 27, 2015 11:59
-
-
Save willnet/ebc6cb9682a250e31f04 to your computer and use it in GitHub Desktop.
create image whose file size you can specify for test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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