hopefully pushing the new branch

This commit is contained in:
Monqui 2025-10-14 22:34:16 +00:00
parent 8059244ef8
commit a71a1b6356
2 changed files with 7 additions and 17 deletions

View file

@ -6,13 +6,14 @@ class EncodeImage
@@utils = nil
def initialize(p, m, i)
@@password = p
@@message = m
@@utils = ImageUtils.new(@@password, @@message, i)
@@original_name = n
@@table = @@utils.generateLookupTable
end
@ -30,23 +31,10 @@ class EncodeImage
msg_bits = pixel.encodeBits(msg_bits)
end
# for x in 0..s[:width]-1
# for y in 0..s[:height]-1
# loc = {"x": x, "y": y}
# if @@table.include? loc then
# pixel = @@utils.getImage.getPixel(x, y)
# msg_bits = pixel.encodeBits(msg_bits)
# end
# end
# end
@@utils.getImage.saveImage
end
# Need to properly sever this at some point...
def decode
puts "Hacked in decode..."
s = @@utils.getImage.getSize
@ -85,4 +73,4 @@ puts "Padding passed scrutiny..."
return msg
end
end
end

View file

@ -3,7 +3,9 @@ require "rmagick"
require "./image_utils.rb"
require "./encode_image.rb"
img = Magick::ImageList.new "./images/original/arty_2.jpg"
img_name = "arty"
img = Magick::ImageList.new "./images/original/" + img_name + ".jpg"
#srand(12345)
@ -26,7 +28,7 @@ puts "Initializing EncodeImage..."
start = Time.new.to_f
em = EncodeImage.new(pass, message, img)
em = EncodeImage.new(pass, message, img, img_name)
puts em.encode
puts "Took " + (Time.new.to_f - start).to_s + " seconds to encode... 🐱"