OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git]
/
app
/
assets
/
javascripts
/
pettanr
/
pettan_imager.js.coffee
1
class Pettanr.Imager
2
@thumbnail_size: (w, h) ->
3
lw = Manifest.manifest().magic_numbers['thumbnail_width']
4
lh = Manifest.manifest().magic_numbers['thumbnail_height']
5
Pettanr.Imager.fix_size_both lw, lh, w, h
6
7
@fix_size_both: (limw, limh, w, h)->
8
wr = if w > limw
9
limw*100/w
10
else
11
100
12
hr = if h > limh
13
limh*100/h
14
else
15
100
16
r = if wr < hr
17
[w*wr/100, h*wr/100]
18
else
19
[w*hr/100, h*hr/100]
20
r
21