Skip to content

Commit

Permalink
Make image transparent before doing anything if requesting transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
malomalo committed Sep 19, 2023
1 parent af81390 commit 5ed069d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bob_ross.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def encode_transformations(options = {})
end
end

pre_transform_options.join('') + transform_options.join('') + post_transform_options.join('')
pre_transform_options.join('') + transform_options.join('') + post_transform_options.sort.join('')
end

# Delegates all uncauge class method calls to the singleton
Expand Down
2 changes: 2 additions & 0 deletions lib/bob_ross/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def transform(transformations, options={})
return @source if transformations.empty? && @mime_type == options[:format] && [nil, 1].include?(@orientation)
options[:format] ||= mime_type

transformations.unshift({transparent: true}) if options[:transparent]

transformations.each do |t|
if t[:padding]
padding = t[:padding].split(',')
Expand Down
2 changes: 0 additions & 2 deletions lib/bob_ross/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ def extract_transformations(string)
transformations << { padding: value }
when 'S'
transformations << { resize: value }
when 'T'
transformations << { transparent: true }
when 'W'
transformations << { watermark: value }
end
Expand Down

0 comments on commit 5ed069d

Please sign in to comment.