Compare commits
No commits in common. "8a34fe76a213200497f46ceeb24e8542cb46bfec" and "c241dc33b03af0281cb0c0f441be8da83999de87" have entirely different histories.
8a34fe76a2
...
c241dc33b0
106 changed files with 206 additions and 149 deletions
24
.solargraph.yml
Normal file
24
.solargraph.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
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
|
||||
8
Gemfile
8
Gemfile
|
|
@ -25,7 +25,7 @@ gem 'turbo-rails', '~> 2.0'
|
|||
gem 'devise', '~> 4.9', '>= 4.9.2'
|
||||
gem 'devise-encryptable', '~> 0.2.0'
|
||||
gem 'omniauth', '~> 2.1'
|
||||
gem 'omniauth-rails_csrf_protection', '~> 2.0', '>= 2.0.1'
|
||||
gem 'omniauth-rails_csrf_protection', '~> 1.0'
|
||||
gem "omniauth_openid_connect", "~> 0.7.1"
|
||||
|
||||
# For pagination UI.
|
||||
|
|
@ -85,6 +85,12 @@ gem "sentry-rails", "~> 5.12"
|
|||
# For tasks that use shell commands.
|
||||
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.
|
||||
group :development, :test do
|
||||
gem "rspec-rails", "~> 7.0"
|
||||
|
|
|
|||
224
Gemfile.lock
224
Gemfile.lock
|
|
@ -6,31 +6,31 @@ PATH
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
action_text-trix (2.1.16)
|
||||
action_text-trix (2.1.15)
|
||||
railties
|
||||
actioncable (8.1.2)
|
||||
actionpack (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
actioncable (8.1.1)
|
||||
actionpack (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
zeitwerk (~> 2.6)
|
||||
actionmailbox (8.1.2)
|
||||
actionpack (= 8.1.2)
|
||||
activejob (= 8.1.2)
|
||||
activerecord (= 8.1.2)
|
||||
activestorage (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
actionmailbox (8.1.1)
|
||||
actionpack (= 8.1.1)
|
||||
activejob (= 8.1.1)
|
||||
activerecord (= 8.1.1)
|
||||
activestorage (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
mail (>= 2.8.0)
|
||||
actionmailer (8.1.2)
|
||||
actionpack (= 8.1.2)
|
||||
actionview (= 8.1.2)
|
||||
activejob (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
actionmailer (8.1.1)
|
||||
actionpack (= 8.1.1)
|
||||
actionview (= 8.1.1)
|
||||
activejob (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
mail (>= 2.8.0)
|
||||
rails-dom-testing (~> 2.2)
|
||||
actionpack (8.1.2)
|
||||
actionview (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
actionpack (8.1.1)
|
||||
actionview (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
nokogiri (>= 1.8.5)
|
||||
rack (>= 2.2.4)
|
||||
rack-session (>= 1.0.1)
|
||||
|
|
@ -38,36 +38,36 @@ GEM
|
|||
rails-dom-testing (~> 2.2)
|
||||
rails-html-sanitizer (~> 1.6)
|
||||
useragent (~> 0.16)
|
||||
actiontext (8.1.2)
|
||||
actiontext (8.1.1)
|
||||
action_text-trix (~> 2.1.15)
|
||||
actionpack (= 8.1.2)
|
||||
activerecord (= 8.1.2)
|
||||
activestorage (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
actionpack (= 8.1.1)
|
||||
activerecord (= 8.1.1)
|
||||
activestorage (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
globalid (>= 0.6.0)
|
||||
nokogiri (>= 1.8.5)
|
||||
actionview (8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
actionview (8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.11)
|
||||
rails-dom-testing (~> 2.2)
|
||||
rails-html-sanitizer (~> 1.6)
|
||||
activejob (8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
activejob (8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
activerecord (8.1.2)
|
||||
activemodel (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
activemodel (8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
activerecord (8.1.1)
|
||||
activemodel (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
timeout (>= 0.4.0)
|
||||
activestorage (8.1.2)
|
||||
actionpack (= 8.1.2)
|
||||
activejob (= 8.1.2)
|
||||
activerecord (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
activestorage (8.1.1)
|
||||
actionpack (= 8.1.1)
|
||||
activejob (= 8.1.1)
|
||||
activerecord (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
marcel (~> 1.0)
|
||||
activesupport (8.1.2)
|
||||
activesupport (8.1.1)
|
||||
base64
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.3.1)
|
||||
|
|
@ -83,13 +83,14 @@ GEM
|
|||
addressable (2.8.8)
|
||||
public_suffix (>= 2.0.2, < 8.0)
|
||||
aes_key_wrap (1.1.0)
|
||||
async (2.35.3)
|
||||
ast (2.4.3)
|
||||
async (2.35.0)
|
||||
console (~> 1.29)
|
||||
fiber-annotation
|
||||
io-event (~> 1.11)
|
||||
metrics (~> 0.12)
|
||||
traces (~> 0.18)
|
||||
async-container (0.29.0)
|
||||
async-container (0.27.7)
|
||||
async (~> 2.22)
|
||||
async-http (0.89.0)
|
||||
async (>= 2.10.2)
|
||||
|
|
@ -105,17 +106,19 @@ GEM
|
|||
async-http (~> 0.56)
|
||||
async-pool (0.11.1)
|
||||
async (>= 2.0)
|
||||
async-service (0.17.0)
|
||||
async-service (0.16.0)
|
||||
async
|
||||
async-container (~> 0.28)
|
||||
async-container (~> 0.16)
|
||||
string-format (~> 0.2)
|
||||
attr_required (1.0.2)
|
||||
backport (1.2.0)
|
||||
base64 (0.3.0)
|
||||
bcrypt (3.1.21)
|
||||
bcrypt (3.1.20)
|
||||
benchmark (0.5.0)
|
||||
bigdecimal (4.0.1)
|
||||
bindata (2.5.1)
|
||||
bindex (0.8.1)
|
||||
bootsnap (1.21.1)
|
||||
bootsnap (1.20.1)
|
||||
msgpack (~> 1.2)
|
||||
builder (3.3.0)
|
||||
childprocess (5.1.0)
|
||||
|
|
@ -171,13 +174,14 @@ GEM
|
|||
faraday-net_http (>= 2.0, < 3.5)
|
||||
json
|
||||
logger
|
||||
faraday-follow_redirects (0.5.0)
|
||||
faraday-follow_redirects (0.4.0)
|
||||
faraday (>= 1, < 3)
|
||||
faraday-net_http (3.4.2)
|
||||
net-http (~> 0.5)
|
||||
ffi (1.17.3-aarch64-linux-gnu)
|
||||
ffi (1.17.3-arm64-darwin)
|
||||
ffi (1.17.3-x86_64-linux-gnu)
|
||||
ffi (1.17.2)
|
||||
ffi (1.17.2-aarch64-linux-gnu)
|
||||
ffi (1.17.2-arm64-darwin)
|
||||
ffi (1.17.2-x86_64-linux-gnu)
|
||||
fiber-annotation (0.2.0)
|
||||
fiber-local (1.1.0)
|
||||
fiber-storage
|
||||
|
|
@ -202,6 +206,7 @@ GEM
|
|||
pp (>= 0.6.0)
|
||||
rdoc (>= 4.0.0)
|
||||
reline (>= 0.4.2)
|
||||
jaro_winkler (1.6.1)
|
||||
jsbundling-rails (1.3.1)
|
||||
railties (>= 6.0.0)
|
||||
json (2.18.0)
|
||||
|
|
@ -212,13 +217,19 @@ GEM
|
|||
bindata
|
||||
faraday (~> 2.0)
|
||||
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)
|
||||
addressable (~> 2.8)
|
||||
childprocess (~> 5.0)
|
||||
logger (~> 1.6)
|
||||
letter_opener (1.10.0)
|
||||
launchy (>= 2.2, < 4)
|
||||
localhost (1.7.0)
|
||||
lint_roller (1.1.0)
|
||||
localhost (1.6.0)
|
||||
logger (1.7.0)
|
||||
loofah (2.25.0)
|
||||
crass (~> 1.0.2)
|
||||
|
|
@ -251,18 +262,18 @@ GEM
|
|||
net-smtp (0.5.1)
|
||||
net-protocol
|
||||
nio4r (2.7.5)
|
||||
nokogiri (1.19.0-aarch64-linux-gnu)
|
||||
nokogiri (1.18.10-aarch64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.19.0-arm64-darwin)
|
||||
nokogiri (1.18.10-arm64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.19.0-x86_64-linux-gnu)
|
||||
nokogiri (1.18.10-x86_64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
omniauth (2.1.4)
|
||||
hashie (>= 3.4.6)
|
||||
logger
|
||||
rack (>= 2.2.3)
|
||||
rack-protection
|
||||
omniauth-rails_csrf_protection (2.0.1)
|
||||
omniauth-rails_csrf_protection (1.0.2)
|
||||
actionpack (>= 4.2)
|
||||
omniauth (~> 2.0)
|
||||
omniauth_openid_connect (0.7.1)
|
||||
|
|
@ -283,29 +294,33 @@ GEM
|
|||
webfinger (~> 2.0)
|
||||
openssl (3.3.2)
|
||||
orm_adapter (0.5.0)
|
||||
parallel (1.27.0)
|
||||
parser (3.3.10.0)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
pp (0.6.3)
|
||||
prettyprint
|
||||
prettyprint (0.2.0)
|
||||
prism (1.8.0)
|
||||
prism (1.7.0)
|
||||
process-metrics (0.8.0)
|
||||
console (~> 1.8)
|
||||
json (~> 2)
|
||||
samovar (~> 2.1)
|
||||
protocol-hpack (1.5.1)
|
||||
protocol-http (0.58.0)
|
||||
protocol-http1 (0.36.0)
|
||||
protocol-http (~> 0.58)
|
||||
protocol-http2 (0.24.0)
|
||||
protocol-http (0.56.1)
|
||||
protocol-http1 (0.35.2)
|
||||
protocol-http (~> 0.22)
|
||||
protocol-http2 (0.23.0)
|
||||
protocol-hpack (~> 1.4)
|
||||
protocol-http (~> 0.47)
|
||||
protocol-rack (0.21.0)
|
||||
protocol-rack (0.19.0)
|
||||
io-stream (>= 0.10)
|
||||
protocol-http (~> 0.58)
|
||||
protocol-http (~> 0.43)
|
||||
rack (>= 1.0)
|
||||
psych (5.3.1)
|
||||
date
|
||||
stringio
|
||||
public_suffix (7.0.2)
|
||||
public_suffix (7.0.0)
|
||||
racc (1.8.1)
|
||||
rack (3.2.4)
|
||||
rack-attack (6.8.0)
|
||||
|
|
@ -330,20 +345,20 @@ GEM
|
|||
rack (>= 1.3)
|
||||
rackup (2.3.1)
|
||||
rack (>= 3)
|
||||
rails (8.1.2)
|
||||
actioncable (= 8.1.2)
|
||||
actionmailbox (= 8.1.2)
|
||||
actionmailer (= 8.1.2)
|
||||
actionpack (= 8.1.2)
|
||||
actiontext (= 8.1.2)
|
||||
actionview (= 8.1.2)
|
||||
activejob (= 8.1.2)
|
||||
activemodel (= 8.1.2)
|
||||
activerecord (= 8.1.2)
|
||||
activestorage (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
rails (8.1.1)
|
||||
actioncable (= 8.1.1)
|
||||
actionmailbox (= 8.1.1)
|
||||
actionmailer (= 8.1.1)
|
||||
actionpack (= 8.1.1)
|
||||
actiontext (= 8.1.1)
|
||||
actionview (= 8.1.1)
|
||||
activejob (= 8.1.1)
|
||||
activemodel (= 8.1.1)
|
||||
activerecord (= 8.1.1)
|
||||
activestorage (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 8.1.2)
|
||||
railties (= 8.1.1)
|
||||
rails-dom-testing (2.3.0)
|
||||
activesupport (>= 5.0.0)
|
||||
minitest
|
||||
|
|
@ -354,26 +369,31 @@ GEM
|
|||
rails-i18n (8.1.0)
|
||||
i18n (>= 0.7, < 2)
|
||||
railties (>= 8.0.0, < 9)
|
||||
railties (8.1.2)
|
||||
actionpack (= 8.1.2)
|
||||
activesupport (= 8.1.2)
|
||||
railties (8.1.1)
|
||||
actionpack (= 8.1.1)
|
||||
activesupport (= 8.1.1)
|
||||
irb (~> 1.13)
|
||||
rackup (>= 1.0.0)
|
||||
rake (>= 12.2)
|
||||
thor (~> 1.0, >= 1.2.2)
|
||||
tsort (>= 0.2)
|
||||
zeitwerk (~> 2.6)
|
||||
rainbow (3.1.1)
|
||||
rake (13.3.1)
|
||||
rbs (2.8.4)
|
||||
rdiscount (2.2.7.3)
|
||||
rdoc (7.1.0)
|
||||
rdoc (7.0.3)
|
||||
erb
|
||||
psych (>= 4.0.0)
|
||||
tsort
|
||||
regexp_parser (2.11.3)
|
||||
reline (0.6.3)
|
||||
io-console (~> 0.5)
|
||||
responders (3.2.0)
|
||||
actionpack (>= 7.0)
|
||||
railties (>= 7.0)
|
||||
reverse_markdown (2.1.1)
|
||||
nokogiri
|
||||
rexml (3.4.4)
|
||||
rspec-core (3.13.6)
|
||||
rspec-support (~> 3.13.0)
|
||||
|
|
@ -392,6 +412,21 @@ GEM
|
|||
rspec-mocks (~> 3.13)
|
||||
rspec-support (~> 3.13)
|
||||
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)
|
||||
ffi (~> 1.12)
|
||||
logger
|
||||
|
|
@ -421,6 +456,25 @@ GEM
|
|||
shell (0.8.1)
|
||||
e2mmap
|
||||
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)
|
||||
concurrent-ruby (~> 1.0)
|
||||
logger
|
||||
|
|
@ -441,17 +495,20 @@ GEM
|
|||
temple (0.10.4)
|
||||
terser (1.2.6)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
thor (1.5.0)
|
||||
thor (1.4.0)
|
||||
thread-local (1.1.0)
|
||||
tilt (2.7.0)
|
||||
tilt (2.6.1)
|
||||
timeout (0.6.0)
|
||||
traces (0.18.2)
|
||||
tsort (0.2.0)
|
||||
turbo-rails (2.0.21)
|
||||
turbo-rails (2.0.20)
|
||||
actionpack (>= 7.1.0)
|
||||
railties (>= 7.1.0)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (3.2.0)
|
||||
unicode-emoji (~> 4.1)
|
||||
unicode-emoji (4.2.0)
|
||||
uri (1.1.1)
|
||||
useragent (0.16.11)
|
||||
validate_url (1.0.15)
|
||||
|
|
@ -477,6 +534,7 @@ GEM
|
|||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
will_paginate (4.0.1)
|
||||
yard (0.9.38)
|
||||
zeitwerk (2.7.4)
|
||||
|
||||
PLATFORMS
|
||||
|
|
@ -503,7 +561,7 @@ DEPENDENCIES
|
|||
mysql2 (~> 0.5.5)
|
||||
nokogiri (~> 1.15, >= 1.15.3)
|
||||
omniauth (~> 2.1)
|
||||
omniauth-rails_csrf_protection (~> 2.0, >= 2.0.1)
|
||||
omniauth-rails_csrf_protection (~> 1.0)
|
||||
omniauth_openid_connect (~> 0.7.1)
|
||||
rack-attack (~> 6.7)
|
||||
rack-mini-profiler (~> 3.1)
|
||||
|
|
@ -517,6 +575,8 @@ DEPENDENCIES
|
|||
sentry-rails (~> 5.12)
|
||||
sentry-ruby (~> 5.12)
|
||||
shell (~> 0.8.1)
|
||||
solargraph (~> 0.50.0)
|
||||
solargraph-rails (~> 1.1)
|
||||
sprockets (~> 4.2)
|
||||
stackprof (~> 0.2.25)
|
||||
terser (~> 1.1, >= 1.1.17)
|
||||
|
|
|
|||
27
bin/solargraph
Executable file
27
bin/solargraph
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/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")
|
||||
|
|
@ -31,19 +31,12 @@ class OutfitImageRenderer
|
|||
begin
|
||||
layer_image = Vips::Image.new_from_buffer(image_data, "")
|
||||
|
||||
# Resize the layer to fit the canvas size
|
||||
# All layer images are square, but may not be CANVAS_SIZE x CANVAS_SIZE
|
||||
# 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
|
||||
# Center the layer on the canvas
|
||||
x_offset = (CANVAS_SIZE - layer_image.width) / 2
|
||||
y_offset = (CANVAS_SIZE - layer_image.height) / 2
|
||||
|
||||
# Composite this layer onto the canvas at (0, 0)
|
||||
# No offset needed since the layer is now exactly canvas-sized
|
||||
canvas = canvas.composite([layer_image], :over)
|
||||
# Composite this layer onto the canvas
|
||||
canvas = canvas.composite([layer_image], :over, x: x_offset, y: y_offset)
|
||||
rescue Vips::Error => e
|
||||
# Log and skip layers that fail to load/composite
|
||||
Rails.logger.warn "Failed to composite layer #{layer.id} (#{layer.image_url}): #{e.message}"
|
||||
|
|
|
|||
BIN
spec/fixtures/outfit_images/Blue Acara With Cape.png
vendored
BIN
spec/fixtures/outfit_images/Blue Acara With Cape.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
BIN
spec/fixtures/outfit_images/Cape.png
vendored
BIN
spec/fixtures/outfit_images/Cape.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB |
|
|
@ -182,59 +182,5 @@ RSpec.describe OutfitImageRenderer do
|
|||
expect(result).to be_nil
|
||||
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
|
||||
|
|
|
|||
BIN
vendor/cache/action_text-trix-2.1.15.gem
vendored
Normal file
BIN
vendor/cache/action_text-trix-2.1.15.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/action_text-trix-2.1.16.gem
vendored
BIN
vendor/cache/action_text-trix-2.1.16.gem
vendored
Binary file not shown.
BIN
vendor/cache/actioncable-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/actioncable-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/actioncable-8.1.2.gem
vendored
BIN
vendor/cache/actioncable-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/actionmailbox-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/actionmailbox-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/actionmailbox-8.1.2.gem
vendored
BIN
vendor/cache/actionmailbox-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/actionmailer-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/actionmailer-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/actionmailer-8.1.2.gem
vendored
BIN
vendor/cache/actionmailer-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/actionpack-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/actionpack-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/actionpack-8.1.2.gem
vendored
BIN
vendor/cache/actionpack-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/actiontext-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/actiontext-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/actiontext-8.1.2.gem
vendored
BIN
vendor/cache/actiontext-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/actionview-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/actionview-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/actionview-8.1.2.gem
vendored
BIN
vendor/cache/actionview-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/activejob-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/activejob-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/activejob-8.1.2.gem
vendored
BIN
vendor/cache/activejob-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/activemodel-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/activemodel-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/activemodel-8.1.2.gem
vendored
BIN
vendor/cache/activemodel-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/activerecord-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/activerecord-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/activerecord-8.1.2.gem
vendored
BIN
vendor/cache/activerecord-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/activestorage-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/activestorage-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/activestorage-8.1.2.gem
vendored
BIN
vendor/cache/activestorage-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/activesupport-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/activesupport-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/activesupport-8.1.2.gem
vendored
BIN
vendor/cache/activesupport-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/ast-2.4.3.gem
vendored
Normal file
BIN
vendor/cache/ast-2.4.3.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/async-2.35.0.gem
vendored
Normal file
BIN
vendor/cache/async-2.35.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/async-2.35.3.gem
vendored
BIN
vendor/cache/async-2.35.3.gem
vendored
Binary file not shown.
BIN
vendor/cache/async-container-0.27.7.gem
vendored
Normal file
BIN
vendor/cache/async-container-0.27.7.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/async-container-0.29.0.gem
vendored
BIN
vendor/cache/async-container-0.29.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/async-service-0.16.0.gem
vendored
Normal file
BIN
vendor/cache/async-service-0.16.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/async-service-0.17.0.gem
vendored
BIN
vendor/cache/async-service-0.17.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/backport-1.2.0.gem
vendored
Normal file
BIN
vendor/cache/backport-1.2.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/bcrypt-3.1.20.gem
vendored
Normal file
BIN
vendor/cache/bcrypt-3.1.20.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/bcrypt-3.1.21.gem
vendored
BIN
vendor/cache/bcrypt-3.1.21.gem
vendored
Binary file not shown.
BIN
vendor/cache/benchmark-0.5.0.gem
vendored
Normal file
BIN
vendor/cache/benchmark-0.5.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/bootsnap-1.20.1.gem
vendored
Normal file
BIN
vendor/cache/bootsnap-1.20.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/bootsnap-1.21.1.gem
vendored
BIN
vendor/cache/bootsnap-1.21.1.gem
vendored
Binary file not shown.
BIN
vendor/cache/faraday-follow_redirects-0.4.0.gem
vendored
Normal file
BIN
vendor/cache/faraday-follow_redirects-0.4.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/faraday-follow_redirects-0.5.0.gem
vendored
BIN
vendor/cache/faraday-follow_redirects-0.5.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/ffi-1.17.2-aarch64-linux-gnu.gem
vendored
Normal file
BIN
vendor/cache/ffi-1.17.2-aarch64-linux-gnu.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/ffi-1.17.2-arm64-darwin.gem
vendored
Normal file
BIN
vendor/cache/ffi-1.17.2-arm64-darwin.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/ffi-1.17.2-x86_64-linux-gnu.gem
vendored
Normal file
BIN
vendor/cache/ffi-1.17.2-x86_64-linux-gnu.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/ffi-1.17.2.gem
vendored
Normal file
BIN
vendor/cache/ffi-1.17.2.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/ffi-1.17.3-aarch64-linux-gnu.gem
vendored
BIN
vendor/cache/ffi-1.17.3-aarch64-linux-gnu.gem
vendored
Binary file not shown.
BIN
vendor/cache/ffi-1.17.3-arm64-darwin.gem
vendored
BIN
vendor/cache/ffi-1.17.3-arm64-darwin.gem
vendored
Binary file not shown.
BIN
vendor/cache/ffi-1.17.3-x86_64-linux-gnu.gem
vendored
BIN
vendor/cache/ffi-1.17.3-x86_64-linux-gnu.gem
vendored
Binary file not shown.
BIN
vendor/cache/jaro_winkler-1.6.1.gem
vendored
Normal file
BIN
vendor/cache/jaro_winkler-1.6.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/kramdown-2.5.1.gem
vendored
Normal file
BIN
vendor/cache/kramdown-2.5.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/kramdown-parser-gfm-1.1.0.gem
vendored
Normal file
BIN
vendor/cache/kramdown-parser-gfm-1.1.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/language_server-protocol-3.17.0.5.gem
vendored
Normal file
BIN
vendor/cache/language_server-protocol-3.17.0.5.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/lint_roller-1.1.0.gem
vendored
Normal file
BIN
vendor/cache/lint_roller-1.1.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/localhost-1.6.0.gem
vendored
Normal file
BIN
vendor/cache/localhost-1.6.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/localhost-1.7.0.gem
vendored
BIN
vendor/cache/localhost-1.7.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/nokogiri-1.18.10-arm64-darwin.gem
vendored
Normal file
BIN
vendor/cache/nokogiri-1.18.10-arm64-darwin.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/nokogiri-1.18.10.gem
vendored
Normal file
BIN
vendor/cache/nokogiri-1.18.10.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/nokogiri-1.19.0-aarch64-linux-gnu.gem
vendored
BIN
vendor/cache/nokogiri-1.19.0-aarch64-linux-gnu.gem
vendored
Binary file not shown.
BIN
vendor/cache/nokogiri-1.19.0-arm64-darwin.gem
vendored
BIN
vendor/cache/nokogiri-1.19.0-arm64-darwin.gem
vendored
Binary file not shown.
BIN
vendor/cache/nokogiri-1.19.0-x86_64-linux-gnu.gem
vendored
BIN
vendor/cache/nokogiri-1.19.0-x86_64-linux-gnu.gem
vendored
Binary file not shown.
BIN
vendor/cache/omniauth-rails_csrf_protection-1.0.2.gem
vendored
Normal file
BIN
vendor/cache/omniauth-rails_csrf_protection-1.0.2.gem
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
vendor/cache/parallel-1.27.0.gem
vendored
Normal file
BIN
vendor/cache/parallel-1.27.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/parser-3.3.10.0.gem
vendored
Normal file
BIN
vendor/cache/parser-3.3.10.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/prism-1.7.0.gem
vendored
Normal file
BIN
vendor/cache/prism-1.7.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/prism-1.8.0.gem
vendored
BIN
vendor/cache/prism-1.8.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/protocol-http-0.56.1.gem
vendored
Normal file
BIN
vendor/cache/protocol-http-0.56.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/protocol-http-0.58.0.gem
vendored
BIN
vendor/cache/protocol-http-0.58.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/protocol-http1-0.35.2.gem
vendored
Normal file
BIN
vendor/cache/protocol-http1-0.35.2.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/protocol-http1-0.36.0.gem
vendored
BIN
vendor/cache/protocol-http1-0.36.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/protocol-http2-0.23.0.gem
vendored
Normal file
BIN
vendor/cache/protocol-http2-0.23.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/protocol-http2-0.24.0.gem
vendored
BIN
vendor/cache/protocol-http2-0.24.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/protocol-rack-0.19.0.gem
vendored
Normal file
BIN
vendor/cache/protocol-rack-0.19.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/protocol-rack-0.21.0.gem
vendored
BIN
vendor/cache/protocol-rack-0.21.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/public_suffix-7.0.0.gem
vendored
Normal file
BIN
vendor/cache/public_suffix-7.0.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/public_suffix-7.0.2.gem
vendored
BIN
vendor/cache/public_suffix-7.0.2.gem
vendored
Binary file not shown.
Binary file not shown.
BIN
vendor/cache/railties-8.1.1.gem
vendored
Normal file
BIN
vendor/cache/railties-8.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/railties-8.1.2.gem
vendored
BIN
vendor/cache/railties-8.1.2.gem
vendored
Binary file not shown.
BIN
vendor/cache/rainbow-3.1.1.gem
vendored
Normal file
BIN
vendor/cache/rainbow-3.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rbs-2.8.4.gem
vendored
Normal file
BIN
vendor/cache/rbs-2.8.4.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rdoc-7.0.3.gem
vendored
Normal file
BIN
vendor/cache/rdoc-7.0.3.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rdoc-7.1.0.gem
vendored
BIN
vendor/cache/rdoc-7.1.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/regexp_parser-2.11.3.gem
vendored
Normal file
BIN
vendor/cache/regexp_parser-2.11.3.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/reverse_markdown-2.1.1.gem
vendored
Normal file
BIN
vendor/cache/reverse_markdown-2.1.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rubocop-1.82.1.gem
vendored
Normal file
BIN
vendor/cache/rubocop-1.82.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rubocop-ast-1.48.0.gem
vendored
Normal file
BIN
vendor/cache/rubocop-ast-1.48.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/ruby-progressbar-1.13.0.gem
vendored
Normal file
BIN
vendor/cache/ruby-progressbar-1.13.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/solargraph-0.50.0.gem
vendored
Normal file
BIN
vendor/cache/solargraph-0.50.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/solargraph-rails-1.2.4.gem
vendored
Normal file
BIN
vendor/cache/solargraph-rails-1.2.4.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/thor-1.4.0.gem
vendored
Normal file
BIN
vendor/cache/thor-1.4.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/thor-1.5.0.gem
vendored
BIN
vendor/cache/thor-1.5.0.gem
vendored
Binary file not shown.
BIN
vendor/cache/tilt-2.6.1.gem
vendored
Normal file
BIN
vendor/cache/tilt-2.6.1.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/tilt-2.7.0.gem
vendored
BIN
vendor/cache/tilt-2.7.0.gem
vendored
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue