Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
d04c64ec
Commit
d04c64ec
authored
Aug 30, 2013
by
fred
Browse files
thumbnail: do not try resizing missing files
parent
09a4602a
Changes
1
Hide whitespace changes
Inline
Side-by-side
panikweb/paniktags/templatetags/thumbnails.py
View file @
d04c64ec
...
...
@@ -28,7 +28,7 @@ def thumbnail(image, size='100x100'):
os
.
path
.
getmtime
(
filename
)
>
os
.
path
.
getmtime
(
miniature_filename
):
os
.
unlink
(
miniature_filename
)
# if the image wasn't already resized, resize it
if
not
os
.
path
.
exists
(
miniature_filename
):
if
not
os
.
path
.
exists
(
miniature_filename
)
and
os
.
path
.
exists
(
filename
)
:
image
=
Image
.
open
(
filename
)
if
abs
(
(
1.0
*
x
/
y
)
-
(
1.0
*
image
.
size
[
0
]
/
image
.
size
[
1
])
)
>
0.1
:
# aspect ratio change, crop the image first
...
...
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