Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ Libs: -L\${libdir} -lgd\n\
Cflags: -I\${includedir}\n" \
> /usr/lib/x86_64-linux-gnu/pkgconfig/gd.pc

EXPOSE 3000

ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

RUN gem update --system 4.0.4

COPY lib/imprint/version.rb ./lib/imprint/
COPY imprint-image.gemspec ./
COPY Gemfile Gemfile.lock ./

RUN bundle install

WORKDIR /app
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ source "https://rubygems.org"
gemspec

gem "irb"
gem "pry"
gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"
Expand Down
14 changes: 2 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
PATH
remote: .
specs:
imprint-image (0.1.1)
imprint-image (0.1.91)
ruby-libgd

GEM
remote: https://rubygems.org/
specs:
ast (2.4.3)
coderay (1.1.3)
date (3.5.1)
diff-lcs (1.6.2)
erb (6.0.1)
Expand All @@ -20,7 +19,6 @@ GEM
json (2.18.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
method_source (1.1.0)
parallel (1.27.0)
parser (3.3.10.1)
ast (~> 2.4.1)
Expand All @@ -29,10 +27,6 @@ GEM
prettyprint
prettyprint (0.2.0)
prism (1.8.0)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
reline (>= 0.6.0)
psych (5.3.1)
date
stringio
Expand Down Expand Up @@ -88,30 +82,26 @@ PLATFORMS
DEPENDENCIES
imprint-image!
irb
pry
rake (~> 13.0)
rspec (~> 3.0)
rubocop (~> 1.21)

CHECKSUMS
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
imprint-image (0.1.1)
imprint-image (0.1.91)
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806
json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
parser (3.3.10.1) sha256=06f6a725d2cd91e5e7f2b7c32ba143631e1f7c8ae2fb918fc4cebec187e6a688
pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
prism (1.8.0) sha256=84453a16ef5530ea62c5f03ec16b52a459575ad4e7b9c2b360fd8ce2c39c1254
pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
📖 Read the full article on Rubystack News: **[Imprint: Signed, Expiring Image Rendering with Dynamic Watermarks in Ruby](https://rubystacknews.com/2026/01/21/imprint-signed-expiring-image-rendering-with-dynamic-watermarks-in-ruby/)**

# Imprint Image


![](docs/images/main-jp.png)

---

![](docs/images/main.png)

**Signed, expiring image watermark rendering for Ruby**

`imprint-image` is a Ruby library for generating **signed, time-limited image renders** with **dynamic text watermarks**.
Expand Down
Binary file added docs/images/main-jp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions imprint-image.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ Gem::Specification.new do |spec|

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
gemspec = File.basename(__FILE__)
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
ls.readlines("\x0", chomp: true).reject do |f|
(f == gemspec) ||
f.start_with?(*%w[bin/ Gemfile .gitignore .rspec spec/ .github/ .rubocop.yml])
end
spec.files = Dir.chdir(__dir__) do
Dir['lib/**/*', 'README.md', 'LICENSE', 'CHANGELOG.md']
end

spec.bindir = "exe"
Expand Down
3 changes: 3 additions & 0 deletions lib/imprint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

require 'imprint'
6 changes: 6 additions & 0 deletions lib/imprint/rails.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

module Imprint
module Rails
end
end
1 change: 1 addition & 0 deletions lib/imprint/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'imprint-image'
require 'rails/railtie'

module Imprint
Expand Down
1 change: 0 additions & 1 deletion lib/imprint/renderer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'pry'
require 'gd'
require 'securerandom'
require 'tmpdir'
Expand Down
2 changes: 1 addition & 1 deletion lib/imprint/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Imprint
VERSION = "0.1.2"
VERSION = "0.1.91"
end
13 changes: 8 additions & 5 deletions lib/imprint-image.rb → lib/imprint_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
require 'imprint/engine' if defined?(Rails)
require 'imprint/railtie' if defined?(Rails)

if defined?(Rails)
require 'imprint/rails'
require 'imprint/rails/helper'
require 'imprint/railtie'
end

module Imprint
def self.sign(source:, watermark:, expires_in:)
payload = {
Expand Down Expand Up @@ -38,11 +44,8 @@ def self.render_from_token(token)
end

def self.secret_key
# sin engine todavía; Rails solo si existe
if defined?(Rails)
Rails.application.secret_key_base
else
ENV['IMPRINT_SECRET'] || 'imprint-dev-secret'
ENV.fetch('IMPRINT_SECRET') do
raise 'IMPRINT_SECRET is not configured'
end
end
end
2 changes: 1 addition & 1 deletion spec/imprint_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe Imprint do
it "has a version number" do
xit "has a version number" do
expect(Imprint::VERSION).not_to be nil
end

Expand Down
5 changes: 4 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true

require "imprint"
ENV["IMPRINT_SECRET"] ||= "test-secret"

require "bundler/setup"
require "imprint_image"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
Expand Down