Compare commits

...

6 commits

Author SHA1 Message Date
8a34fe76a2 Oops, add vendor/cache for all platforms
Locally, I also ran `bundle config set --local cache_all_platforms true` to ensure this happens automatically going forward.
2026-01-17 21:50:10 -08:00
91fba090fa Remove solargraph
This is a Ruby LSP that I no longer use, because I'm on RubyMine full-time.

My immediate motivation for this change is that solargraph's eventual dependency on the `parser` gem triggers warnings on all Rails commands, hinting that it doesn't support the *exact* Ruby version we use.

This could potentially be resolved by upgrading Solargraph or some of its dependencies, but since I'm not using it anyway, may as well just remove!
2026-01-17 21:39:45 -08:00
38956030ed bundle update
Just a general update for bugfixes etc!
2026-01-17 21:34:56 -08:00
56bb87f54f Update omniauth-rails_csrf_protection to 2.0.1
This resolves a deprecation warning for its usage of `ActiveSupport::Configurable`.
2026-01-17 21:32:53 -08:00
59d1f5bae8 Remove now-deprecated has_rdoc config in RocketAMF gemspec
This was causing a deprecation warning. Fixed!
2026-01-17 21:21:42 -08:00
dcbdf17e56 OutfitImageRenderer: Handle different layer sizes
Example: http://localhost:3000/outfits/new.png?species=18&color=40&pose=HAPPY_MASC&objects%5B%5D=78994

Before this change, the cape renders too big. Now, it renders correctly.
2026-01-17 21:20:25 -08:00
106 changed files with 149 additions and 206 deletions

View file

@ -1,24 +0,0 @@
---
include:
- "app/**/*.rb"
- "config/**/*.rb"
exclude:
- "spec/**/*"
- "test/**/*"
- "vendor/**/*"
- ".bundle/**/*"
require:
- actioncable
- actionmailer
- actionpack
- actionview
- activemodel
- activerecord
- activesupport
plugins:
- solargraph-rails
domains: []
reporters:
- require_not_found
require_paths: []
max_files: 5000

View file

@ -25,7 +25,7 @@ gem 'turbo-rails', '~> 2.0'
gem 'devise', '~> 4.9', '>= 4.9.2' gem 'devise', '~> 4.9', '>= 4.9.2'
gem 'devise-encryptable', '~> 0.2.0' gem 'devise-encryptable', '~> 0.2.0'
gem 'omniauth', '~> 2.1' gem 'omniauth', '~> 2.1'
gem 'omniauth-rails_csrf_protection', '~> 1.0' gem 'omniauth-rails_csrf_protection', '~> 2.0', '>= 2.0.1'
gem "omniauth_openid_connect", "~> 0.7.1" gem "omniauth_openid_connect", "~> 0.7.1"
# For pagination UI. # For pagination UI.
@ -85,12 +85,6 @@ gem "sentry-rails", "~> 5.12"
# For tasks that use shell commands. # For tasks that use shell commands.
gem "shell", "~> 0.8.1" gem "shell", "~> 0.8.1"
# For workspace autocomplete.
group :development do
gem "solargraph", "~> 0.50.0"
gem "solargraph-rails", "~> 1.1"
end
# For automated tests. # For automated tests.
group :development, :test do group :development, :test do
gem "rspec-rails", "~> 7.0" gem "rspec-rails", "~> 7.0"

View file

@ -6,31 +6,31 @@ PATH
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
action_text-trix (2.1.15) action_text-trix (2.1.16)
railties railties
actioncable (8.1.1) actioncable (8.1.2)
actionpack (= 8.1.1) actionpack (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
actionmailbox (8.1.1) actionmailbox (8.1.2)
actionpack (= 8.1.1) actionpack (= 8.1.2)
activejob (= 8.1.1) activejob (= 8.1.2)
activerecord (= 8.1.1) activerecord (= 8.1.2)
activestorage (= 8.1.1) activestorage (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
mail (>= 2.8.0) mail (>= 2.8.0)
actionmailer (8.1.1) actionmailer (8.1.2)
actionpack (= 8.1.1) actionpack (= 8.1.2)
actionview (= 8.1.1) actionview (= 8.1.2)
activejob (= 8.1.1) activejob (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
mail (>= 2.8.0) mail (>= 2.8.0)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
actionpack (8.1.1) actionpack (8.1.2)
actionview (= 8.1.1) actionview (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
rack (>= 2.2.4) rack (>= 2.2.4)
rack-session (>= 1.0.1) rack-session (>= 1.0.1)
@ -38,36 +38,36 @@ GEM
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
useragent (~> 0.16) useragent (~> 0.16)
actiontext (8.1.1) actiontext (8.1.2)
action_text-trix (~> 2.1.15) action_text-trix (~> 2.1.15)
actionpack (= 8.1.1) actionpack (= 8.1.2)
activerecord (= 8.1.1) activerecord (= 8.1.2)
activestorage (= 8.1.1) activestorage (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
globalid (>= 0.6.0) globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (8.1.1) actionview (8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.11) erubi (~> 1.11)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
activejob (8.1.1) activejob (8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (8.1.1) activemodel (8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
activerecord (8.1.1) activerecord (8.1.2)
activemodel (= 8.1.1) activemodel (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
timeout (>= 0.4.0) timeout (>= 0.4.0)
activestorage (8.1.1) activestorage (8.1.2)
actionpack (= 8.1.1) actionpack (= 8.1.2)
activejob (= 8.1.1) activejob (= 8.1.2)
activerecord (= 8.1.1) activerecord (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
marcel (~> 1.0) marcel (~> 1.0)
activesupport (8.1.1) activesupport (8.1.2)
base64 base64
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1) concurrent-ruby (~> 1.0, >= 1.3.1)
@ -83,14 +83,13 @@ GEM
addressable (2.8.8) addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0) public_suffix (>= 2.0.2, < 8.0)
aes_key_wrap (1.1.0) aes_key_wrap (1.1.0)
ast (2.4.3) async (2.35.3)
async (2.35.0)
console (~> 1.29) console (~> 1.29)
fiber-annotation fiber-annotation
io-event (~> 1.11) io-event (~> 1.11)
metrics (~> 0.12) metrics (~> 0.12)
traces (~> 0.18) traces (~> 0.18)
async-container (0.27.7) async-container (0.29.0)
async (~> 2.22) async (~> 2.22)
async-http (0.89.0) async-http (0.89.0)
async (>= 2.10.2) async (>= 2.10.2)
@ -106,19 +105,17 @@ GEM
async-http (~> 0.56) async-http (~> 0.56)
async-pool (0.11.1) async-pool (0.11.1)
async (>= 2.0) async (>= 2.0)
async-service (0.16.0) async-service (0.17.0)
async async
async-container (~> 0.16) async-container (~> 0.28)
string-format (~> 0.2) string-format (~> 0.2)
attr_required (1.0.2) attr_required (1.0.2)
backport (1.2.0)
base64 (0.3.0) base64 (0.3.0)
bcrypt (3.1.20) bcrypt (3.1.21)
benchmark (0.5.0)
bigdecimal (4.0.1) bigdecimal (4.0.1)
bindata (2.5.1) bindata (2.5.1)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.20.1) bootsnap (1.21.1)
msgpack (~> 1.2) msgpack (~> 1.2)
builder (3.3.0) builder (3.3.0)
childprocess (5.1.0) childprocess (5.1.0)
@ -174,14 +171,13 @@ GEM
faraday-net_http (>= 2.0, < 3.5) faraday-net_http (>= 2.0, < 3.5)
json json
logger logger
faraday-follow_redirects (0.4.0) faraday-follow_redirects (0.5.0)
faraday (>= 1, < 3) faraday (>= 1, < 3)
faraday-net_http (3.4.2) faraday-net_http (3.4.2)
net-http (~> 0.5) net-http (~> 0.5)
ffi (1.17.2) ffi (1.17.3-aarch64-linux-gnu)
ffi (1.17.2-aarch64-linux-gnu) ffi (1.17.3-arm64-darwin)
ffi (1.17.2-arm64-darwin) ffi (1.17.3-x86_64-linux-gnu)
ffi (1.17.2-x86_64-linux-gnu)
fiber-annotation (0.2.0) fiber-annotation (0.2.0)
fiber-local (1.1.0) fiber-local (1.1.0)
fiber-storage fiber-storage
@ -206,7 +202,6 @@ GEM
pp (>= 0.6.0) pp (>= 0.6.0)
rdoc (>= 4.0.0) rdoc (>= 4.0.0)
reline (>= 0.4.2) reline (>= 0.4.2)
jaro_winkler (1.6.1)
jsbundling-rails (1.3.1) jsbundling-rails (1.3.1)
railties (>= 6.0.0) railties (>= 6.0.0)
json (2.18.0) json (2.18.0)
@ -217,19 +212,13 @@ GEM
bindata bindata
faraday (~> 2.0) faraday (~> 2.0)
faraday-follow_redirects faraday-follow_redirects
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.5)
launchy (3.1.1) launchy (3.1.1)
addressable (~> 2.8) addressable (~> 2.8)
childprocess (~> 5.0) childprocess (~> 5.0)
logger (~> 1.6) logger (~> 1.6)
letter_opener (1.10.0) letter_opener (1.10.0)
launchy (>= 2.2, < 4) launchy (>= 2.2, < 4)
lint_roller (1.1.0) localhost (1.7.0)
localhost (1.6.0)
logger (1.7.0) logger (1.7.0)
loofah (2.25.0) loofah (2.25.0)
crass (~> 1.0.2) crass (~> 1.0.2)
@ -262,18 +251,18 @@ GEM
net-smtp (0.5.1) net-smtp (0.5.1)
net-protocol net-protocol
nio4r (2.7.5) nio4r (2.7.5)
nokogiri (1.18.10-aarch64-linux-gnu) nokogiri (1.19.0-aarch64-linux-gnu)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.10-arm64-darwin) nokogiri (1.19.0-arm64-darwin)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-gnu) nokogiri (1.19.0-x86_64-linux-gnu)
racc (~> 1.4) racc (~> 1.4)
omniauth (2.1.4) omniauth (2.1.4)
hashie (>= 3.4.6) hashie (>= 3.4.6)
logger logger
rack (>= 2.2.3) rack (>= 2.2.3)
rack-protection rack-protection
omniauth-rails_csrf_protection (1.0.2) omniauth-rails_csrf_protection (2.0.1)
actionpack (>= 4.2) actionpack (>= 4.2)
omniauth (~> 2.0) omniauth (~> 2.0)
omniauth_openid_connect (0.7.1) omniauth_openid_connect (0.7.1)
@ -294,33 +283,29 @@ GEM
webfinger (~> 2.0) webfinger (~> 2.0)
openssl (3.3.2) openssl (3.3.2)
orm_adapter (0.5.0) orm_adapter (0.5.0)
parallel (1.27.0)
parser (3.3.10.0)
ast (~> 2.4.1)
racc
pp (0.6.3) pp (0.6.3)
prettyprint prettyprint
prettyprint (0.2.0) prettyprint (0.2.0)
prism (1.7.0) prism (1.8.0)
process-metrics (0.8.0) process-metrics (0.8.0)
console (~> 1.8) console (~> 1.8)
json (~> 2) json (~> 2)
samovar (~> 2.1) samovar (~> 2.1)
protocol-hpack (1.5.1) protocol-hpack (1.5.1)
protocol-http (0.56.1) protocol-http (0.58.0)
protocol-http1 (0.35.2) protocol-http1 (0.36.0)
protocol-http (~> 0.22) protocol-http (~> 0.58)
protocol-http2 (0.23.0) protocol-http2 (0.24.0)
protocol-hpack (~> 1.4) protocol-hpack (~> 1.4)
protocol-http (~> 0.47) protocol-http (~> 0.47)
protocol-rack (0.19.0) protocol-rack (0.21.0)
io-stream (>= 0.10) io-stream (>= 0.10)
protocol-http (~> 0.43) protocol-http (~> 0.58)
rack (>= 1.0) rack (>= 1.0)
psych (5.3.1) psych (5.3.1)
date date
stringio stringio
public_suffix (7.0.0) public_suffix (7.0.2)
racc (1.8.1) racc (1.8.1)
rack (3.2.4) rack (3.2.4)
rack-attack (6.8.0) rack-attack (6.8.0)
@ -345,20 +330,20 @@ GEM
rack (>= 1.3) rack (>= 1.3)
rackup (2.3.1) rackup (2.3.1)
rack (>= 3) rack (>= 3)
rails (8.1.1) rails (8.1.2)
actioncable (= 8.1.1) actioncable (= 8.1.2)
actionmailbox (= 8.1.1) actionmailbox (= 8.1.2)
actionmailer (= 8.1.1) actionmailer (= 8.1.2)
actionpack (= 8.1.1) actionpack (= 8.1.2)
actiontext (= 8.1.1) actiontext (= 8.1.2)
actionview (= 8.1.1) actionview (= 8.1.2)
activejob (= 8.1.1) activejob (= 8.1.2)
activemodel (= 8.1.1) activemodel (= 8.1.2)
activerecord (= 8.1.1) activerecord (= 8.1.2)
activestorage (= 8.1.1) activestorage (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 8.1.1) railties (= 8.1.2)
rails-dom-testing (2.3.0) rails-dom-testing (2.3.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
minitest minitest
@ -369,31 +354,26 @@ GEM
rails-i18n (8.1.0) rails-i18n (8.1.0)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 8.0.0, < 9) railties (>= 8.0.0, < 9)
railties (8.1.1) railties (8.1.2)
actionpack (= 8.1.1) actionpack (= 8.1.2)
activesupport (= 8.1.1) activesupport (= 8.1.2)
irb (~> 1.13) irb (~> 1.13)
rackup (>= 1.0.0) rackup (>= 1.0.0)
rake (>= 12.2) rake (>= 12.2)
thor (~> 1.0, >= 1.2.2) thor (~> 1.0, >= 1.2.2)
tsort (>= 0.2) tsort (>= 0.2)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.3.1) rake (13.3.1)
rbs (2.8.4)
rdiscount (2.2.7.3) rdiscount (2.2.7.3)
rdoc (7.0.3) rdoc (7.1.0)
erb erb
psych (>= 4.0.0) psych (>= 4.0.0)
tsort tsort
regexp_parser (2.11.3)
reline (0.6.3) reline (0.6.3)
io-console (~> 0.5) io-console (~> 0.5)
responders (3.2.0) responders (3.2.0)
actionpack (>= 7.0) actionpack (>= 7.0)
railties (>= 7.0) railties (>= 7.0)
reverse_markdown (2.1.1)
nokogiri
rexml (3.4.4) rexml (3.4.4)
rspec-core (3.13.6) rspec-core (3.13.6)
rspec-support (~> 3.13.0) rspec-support (~> 3.13.0)
@ -412,21 +392,6 @@ GEM
rspec-mocks (~> 3.13) rspec-mocks (~> 3.13)
rspec-support (~> 3.13) rspec-support (~> 3.13)
rspec-support (3.13.6) rspec-support (3.13.6)
rubocop (1.82.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.48.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.48.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
ruby-vips (2.3.0) ruby-vips (2.3.0)
ffi (~> 1.12) ffi (~> 1.12)
logger logger
@ -456,25 +421,6 @@ GEM
shell (0.8.1) shell (0.8.1)
e2mmap e2mmap
sync sync
solargraph (0.50.0)
backport (~> 1.2)
benchmark
bundler (~> 2.0)
diff-lcs (~> 1.4)
e2mmap
jaro_winkler (~> 1.5)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
parser (~> 3.0)
rbs (~> 2.0)
reverse_markdown (~> 2.0)
rubocop (~> 1.38)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
solargraph-rails (1.2.4)
activesupport
solargraph (>= 0.48.0, <= 0.57)
sprockets (4.2.2) sprockets (4.2.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
logger logger
@ -495,20 +441,17 @@ GEM
temple (0.10.4) temple (0.10.4)
terser (1.2.6) terser (1.2.6)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
thor (1.4.0) thor (1.5.0)
thread-local (1.1.0) thread-local (1.1.0)
tilt (2.6.1) tilt (2.7.0)
timeout (0.6.0) timeout (0.6.0)
traces (0.18.2) traces (0.18.2)
tsort (0.2.0) tsort (0.2.0)
turbo-rails (2.0.20) turbo-rails (2.0.21)
actionpack (>= 7.1.0) actionpack (>= 7.1.0)
railties (>= 7.1.0) railties (>= 7.1.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1) uri (1.1.1)
useragent (0.16.11) useragent (0.16.11)
validate_url (1.0.15) validate_url (1.0.15)
@ -534,7 +477,6 @@ GEM
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
will_paginate (4.0.1) will_paginate (4.0.1)
yard (0.9.38)
zeitwerk (2.7.4) zeitwerk (2.7.4)
PLATFORMS PLATFORMS
@ -561,7 +503,7 @@ DEPENDENCIES
mysql2 (~> 0.5.5) mysql2 (~> 0.5.5)
nokogiri (~> 1.15, >= 1.15.3) nokogiri (~> 1.15, >= 1.15.3)
omniauth (~> 2.1) omniauth (~> 2.1)
omniauth-rails_csrf_protection (~> 1.0) omniauth-rails_csrf_protection (~> 2.0, >= 2.0.1)
omniauth_openid_connect (~> 0.7.1) omniauth_openid_connect (~> 0.7.1)
rack-attack (~> 6.7) rack-attack (~> 6.7)
rack-mini-profiler (~> 3.1) rack-mini-profiler (~> 3.1)
@ -575,8 +517,6 @@ DEPENDENCIES
sentry-rails (~> 5.12) sentry-rails (~> 5.12)
sentry-ruby (~> 5.12) sentry-ruby (~> 5.12)
shell (~> 0.8.1) shell (~> 0.8.1)
solargraph (~> 0.50.0)
solargraph-rails (~> 1.1)
sprockets (~> 4.2) sprockets (~> 4.2)
stackprof (~> 0.2.25) stackprof (~> 0.2.25)
terser (~> 1.1, >= 1.1.17) terser (~> 1.1, >= 1.1.17)

View file

@ -1,27 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'solargraph' is installed as part of a gem, and
# this file is here to facilitate running it.
#
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
bundle_binstub = File.expand_path("bundle", __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("solargraph", "solargraph")

View file

@ -31,12 +31,19 @@ class OutfitImageRenderer
begin begin
layer_image = Vips::Image.new_from_buffer(image_data, "") layer_image = Vips::Image.new_from_buffer(image_data, "")
# Center the layer on the canvas # Resize the layer to fit the canvas size
x_offset = (CANVAS_SIZE - layer_image.width) / 2 # All layer images are square, but may not be CANVAS_SIZE x CANVAS_SIZE
y_offset = (CANVAS_SIZE - layer_image.height) / 2 # We need to resize them to exactly CANVAS_SIZE x CANVAS_SIZE
if layer_image.width != CANVAS_SIZE || layer_image.height != CANVAS_SIZE
layer_image = layer_image.resize(
CANVAS_SIZE.to_f / layer_image.width,
vscale: CANVAS_SIZE.to_f / layer_image.height
)
end
# Composite this layer onto the canvas # Composite this layer onto the canvas at (0, 0)
canvas = canvas.composite([layer_image], :over, x: x_offset, y: y_offset) # No offset needed since the layer is now exactly canvas-sized
canvas = canvas.composite([layer_image], :over)
rescue Vips::Error => e rescue Vips::Error => e
# Log and skip layers that fail to load/composite # Log and skip layers that fail to load/composite
Rails.logger.warn "Failed to composite layer #{layer.id} (#{layer.image_url}): #{e.message}" Rails.logger.warn "Failed to composite layer #{layer.id} (#{layer.image_url}): #{e.message}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
spec/fixtures/outfit_images/Cape.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View file

@ -182,5 +182,59 @@ RSpec.describe OutfitImageRenderer do
expect(result).to be_nil expect(result).to be_nil
end end
end end
it "resizes all layers to 600x600 before compositing" do
# Load a 1200x1200 item layer (real-world case from Neopets)
item_1200_png = load_fixture_image('Cape.png')
acara_600_png = load_fixture_image('Blue Acara.png')
expected_composite_png = load_fixture_image('Blue Acara With Cape.png')
# Create assets
biology_asset = build_biology_asset(zones(:head), body_id: 1)
item_asset = build_item_asset(zones(:hat1), body_id: 1)
# Stub HTTP requests
stub_request(:get, biology_asset.image_url).
to_return(body: acara_600_png, status: 200)
stub_request(:get, item_asset.image_url).
to_return(body: item_1200_png, status: 200)
# Build outfit
pet_state = build_pet_state(@pet_type, swf_assets: [biology_asset])
item = build_item("Test Item", swf_assets: [item_asset])
outfit = Outfit.new(
pet_state: pet_state,
worn_items: [item]
)
# Render
renderer = OutfitImageRenderer.new(outfit)
result = renderer.render
# Verify we got valid PNG data
expect(result).not_to be_nil
expect(result).to be_a(String)
expect(result[0..7]).to eq("\x89PNG\r\n\x1A\n".b)
# Verify the result is exactly 600x600
result_image = Vips::Image.new_from_buffer(result, "")
expect(result_image.width).to eq(600)
expect(result_image.height).to eq(600)
# Verify the composite matches the expected image pixel-perfectly
expected_image = Vips::Image.new_from_buffer(expected_composite_png, "")
# Calculate the absolute difference between images
diff = (result_image - expected_image).abs
max_diff = diff.max
# Allow a small tolerance for minor encoding/compositing differences
tolerance = 2
if max_diff > tolerance
debug_path = Rails.root.join('tmp', 'test_render_1200_result.png')
result_image.write_to_file(debug_path.to_s)
fail "Images should match within tolerance of #{tolerance}, but found max difference of #{max_diff}. Actual output saved to #{debug_path}"
end
end
end end
end end

Binary file not shown.

BIN
vendor/cache/action_text-trix-2.1.16.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actioncable-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionmailbox-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionmailer-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionpack-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actiontext-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionview-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activejob-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activemodel-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activerecord-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activestorage-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activesupport-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/async-2.35.3.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/async-container-0.29.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/async-service-0.17.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/bcrypt-3.1.21.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/bootsnap-1.21.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/ffi-1.17.3-arm64-darwin.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/localhost-1.7.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/prism-1.8.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/protocol-http-0.58.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/protocol-http1-0.36.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/protocol-http2-0.24.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/protocol-rack-0.21.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/public_suffix-7.0.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/railties-8.1.2.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rdoc-7.1.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/thor-1.5.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/tilt-2.7.0.gem vendored Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more