Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
80d699ca
Commit
80d699ca
authored
May 28, 2009
by
Mike Richards
Committed by
Jon Yurek
Jul 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added conditional for default scaling of images.
(cherry picked from commit 6a0ff6f0f76a92a25c9cbbc315d3d7d11d1d7720)
parent
2826cdb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
lib/paperclip/thumbnail.rb
+2
-1
test/thumbnail_test.rb
+12
-0
No files found.
lib/paperclip/thumbnail.rb
View file @
80d699ca
...
...
@@ -63,7 +63,8 @@ module Paperclip
# into the thumbnail.
def
transformation_command
scale
,
crop
=
@current_geometry
.
transformation_to
(
@target_geometry
,
crop?
)
trans
=
"-resize
\"
#{
scale
}
\"
"
trans
=
""
trans
<<
" -resize
\"
#{
scale
}
\"
"
unless
scale
.
blank?
trans
<<
" -crop
\"
#{
crop
}
\"
+repage"
if
crop
trans
<<
"
#{
convert_options
}
"
if
convert_options?
trans
...
...
test/thumbnail_test.rb
View file @
80d699ca
...
...
@@ -178,6 +178,18 @@ class ThumbnailTest < Test::Unit::TestCase
end
end
end
context
"being thumbnailed with a blank geometry string"
do
setup
do
@thumb
=
Paperclip
::
Thumbnail
.
new
(
@file
,
:geometry
=>
""
,
:convert_options
=>
"-gravity center -crop
\"
300x300+0-0
\"
"
)
end
should
"not get resized by default"
do
assert_no_match
(
/-resize/
,
@thumb
.
transformation_command
)
end
end
end
context
"A multipage PDF"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment