Skip to content
Browse files

Fixed cropping

  • Loading branch information...
1 parent 10ded9b commit f35a9e7328711ad6726dcc5620f912ef3f095488 @heynemann heynemann committed Jul 31, 2011
Showing with 5 additions and 1 deletion.
  1. +2 −0 myimgat/apps/wall/templates/wall/popin.html
  2. +3 −1 myimgat/apps/wall/views.py
View
2 myimgat/apps/wall/templates/wall/popin.html
@@ -14,6 +14,8 @@
<h2>image title</h2>
<div class="photo"></div>
<a class="share-button" href="#">share photo</a>
+ <h3>Share this url: <span class="url"></span></h3>
+ <h3>Embed: &lt;img src=&quot;<span class="url"></span>&quot; alt=&quot;<span class="title"></span>&quot; /&gt;</h3>
{% csrf_token %}
</div>
<div class="share">
View
4 myimgat/apps/wall/views.py
@@ -70,12 +70,14 @@ def save_cropped_photo(request, username=None):
width = request.POST['width']
height = request.POST['height']
+ fake_original = "%s/unsafe/%s/%s" % (THUMBOR_SERVER, 'fit-in/600x400', format_url(photo.url))
+
url = '/unsafe/%dx%d:%dx%d/smart/%s' % (
int(left),
int(top),
int(left) + int(width),
int(top) + int(height),
- photo.url
+ fake_original
)
cropped = CroppedPhoto.objects.create(

0 comments on commit f35a9e7

Please sign in to comment.
Something went wrong with that request. Please try again.