Wedge

Public area => The Pub => Features => Topic started by: dwx on July 7th, 2012, 02:25 PM

Title: Very cool Thumbnail generation...
Post by: dwx on July 7th, 2012, 02:25 PM
While I've been waiting for you guys to finish Wedge, I've been struggling along with vbulletin 4.2. One of the many things they don't handle well is thumbnail generation, and I found a cool library called "Jcrop" that combines some jquery and php code to intuitively allow users to select an area of a photo to generate a thumbnail.


The code could also be used to resize and select an area of a photo to use as an avatar. Or for any other purpose where there is a size restriction and the user must decide what part of the image to show.


It's released under MIT's open source license, so I think it's free for you to use. Or at the very least, you maybe you'll find inspiration here.  :P


Here's a link to "Deep Liquid's" website with the Jcrop code and demo: http://deepliquid.com/projects/Jcrop/demos.php?demo=live_crop


I know that the same effect can be achieved by uploading a custom thumbnail at the same time the photo is being uploaded, but Jcrop is a LOT easier, and would allow the wedge admin to specify the size and shape of the thumbnails.


dwx

Title: Re: Very cool Thumbnail generation...
Post by: Arantor on July 7th, 2012, 03:46 PM
Interesting, very interesting.
Title: Re: Very cool Thumbnail generation...
Post by: Nao on July 7th, 2012, 07:00 PM
A ruby equivalent was around at the time I worked on AeMe and I actually had a to do entry to implement a Js+Php clone. Jcrop I found out about after I ended work on AeMe though. I think. Or an equivalent.
It is true that I haven't reevaluated this when including AeMe into wedge. Perhaps I should.
Title: Re: Very cool Thumbnail generation...
Post by: dwx on July 8th, 2012, 04:57 AM
Quote from Nao on July 7th, 2012, 07:00 PM
A ruby equivalent was around at the time I worked on AeMe and I actually had a to do entry to implement a Js+Php clone. Jcrop I found out about after I ended work on AeMe though. I think. Or an equivalent.
It is true that I haven't reevaluated this when including AeMe into wedge. Perhaps I should.
Uniform thumbnail size is a feature that really improves the "look" of a gallery, or even an embedded "gallery" attached to a post. Their are a lot of ways to do this, but when I found Jcrop, I realized it was a good way to make relevant thumbnails quickly and simply, and a better alternative to overcropping the center of the image to the minor axis to create a thumbnail.

I figured that Jcrop code would be more useful as an inspiration than anything else, and by the time you were through rewriting it, it would be 4 lines of code and compress down to 12 bytes!  :D

The other thing I've been thinking Jcrop would be useful for is an intermediate sized "preview" image. A smaller subsection of the full image that could be used for an inline preview within the text of a post. Or even with the post text wrapped around the preview image.  :cool:This would allow posts to look more like full-on blog entries.

dwx
Title: Re: Very cool Thumbnail generation...
Post by: live627 on July 8th, 2012, 05:23 AM
Quote
I figured that Jcrop code would be more useful as an inspiration than anything else, and by the time you were through rewriting it, it would be 4 lines of code and compress down to 12 bytes!  :D
What kind of damn script can get that small other than paper? :lol:
Title: Re: Very cool Thumbnail generation...
Post by: dwx on July 8th, 2012, 06:06 AM
Quote from live627 on July 8th, 2012, 05:23 AM
Quote
I figured that Jcrop code would be more useful as an inspiration than anything else, and by the time you were through rewriting it, it would be 4 lines of code and compress down to 12 bytes!  :D
What kind of damn script can get that small other than paper? :lol:
Just a joke, since both Nao and Arantor are both quite skilled at optimization.  :P
Title: Re: Very cool Thumbnail generation...
Post by: Arantor on July 8th, 2012, 06:19 AM
Well... technically all the Wedge JS becomes one line ;)
Title: Re: Very cool Thumbnail generation...
Post by: live627 on July 8th, 2012, 06:31 AM
but not 12 bytes :P
Title: Re: Very cool Thumbnail generation...
Post by: Nao on July 9th, 2012, 10:12 AM
Quote from dwx on July 8th, 2012, 06:06 AM
Just a joke, since both Nao and Arantor are both quite skilled at optimization.  :P
I'm obsessed with it! I think Pete pities me :lol:
Quote from dwx on July 8th, 2012, 04:57 AM
Uniform thumbnail size is a feature that really improves the "look" of a gallery, or even an embedded "gallery" attached to a post. Their are a lot of ways to do this, but when I found Jcrop, I realized it was a good way to make relevant thumbnails quickly and simply, and a better alternative to overcropping the center of the image to the minor axis to create a thumbnail.
It's more complicated than that.
First of all, when I worked on AeMe, as I said I found out about a library to do cropping, but it was written in Ruby. Of course some of it was JS so I considered converting it to clearly use JS+PHP, it was actually in my to-do-list with a high priority. I also found out about Jcrop a few months after that. Anyway, what happened is that I try to fix bugs before adding major features, and I was at a point where I was considering dropping my work on AeMe to focus on non-SMF stuff, so I naturally never implemented that.

Secondly, and I think it's more important, the main reason I didn't implement that is because I was never sure about the upload process being too long already. I wanted to make it simpler, not more complicated, and adding an extra step like this, while certainly helpful in most situations, is not always going to be desired especially when you're trying to turn AeMe into a "perfect gallery", something that could be used stand-alone...
So, my plans were to use it only when requested -- i.e. keep the main file around, generate thumbnails and previews, and then if the user wanted, they could go to the item page, click a "Edit picture" button or something, and have the choice to (1) rotate the picture (and related thumbnail and preview), (2) resize and/or crop the picture, (3) crop the thumbnail or preview based on the stored picture.
I'm NOT very good at implementing good UI (it always takes me weeks to do that when others could do it in days), so at that point it became a low-priority item, even though it was officially high-priority. It's mainly because of UX (user experience), which I wanted to be 'perfect'.

Now, I'm still considering dropping attachments altogether from Wedge, and using AeMe instead. But first of all I'll need to fix some bugs (and even before that, try to spot them all), then work on a parallel implement of attachments vs uploads, and finally get rid of the attachment system and have someone develop a converter (or do it myself within Wedge...)

It's not an easy task, let me tell you. And it's not helpful that none of us is being paid for it...
Quote
I figured that Jcrop code would be more useful as an inspiration than anything else, and by the time you were through rewriting it, it would be 4 lines of code and compress down to 12 bytes!  :D
Well, size doesn't matter here, because it's a process guests don't get, so it has no influence over the apparent speed of a forum, and thus I'm not going to spend a lot of time optimizing it, if anything. Jcrop is a good enough solution, I could rewrite it to use 'proper' indentation and spacing according to my (Wedge's) standards, but I'd rather be able to easily update the script, and/or participate in its development. (Since it's available on github, it's something that can be done.)
Quote
The other thing I've been thinking Jcrop would be useful for is an intermediate sized "preview" image. A smaller subsection of the full image that could be used for an inline preview within the text of a post.
That is already 'done' in my mind.
As a reminder, AeMe has pictures (limited size but usually large), previews (usually 600x400 or something, for use on item pages) and thumbnails (usually 150x100 or something, for use on album pages). Depending on the type of preview (site homepage or blog), I'd automatically attach the thumbnail (on the left of the text preview) or preview (on top of the text preview, or in a carousel for instance).

Don't believe that just because it isn't in Wedge yet, I haven't thought about it a lot already ;)
Just check out http://nao.noisen.com for an example of how I want Wedge blogs to look like. And ideally I want to simply take the first graphic element in each post, get their thumbnail and offer this as post preview in smaller post lists. (eg site homepage, of which I currently have no example for you, except on sites I'm not related to.)
Title: Re: Very cool Thumbnail generation...
Post by: dwx on July 9th, 2012, 12:18 PM
Quote from Nao on July 9th, 2012, 10:12 AM
Secondly, and I think it's more important, the main reason I didn't implement that is because I was never sure about the upload process being too long already. I wanted to make it simpler, not more complicated, and adding an extra step like this, while certainly helpful in most situations, is not always going to be desired especially when you're trying to turn AeMe into a "perfect gallery", something that could be used stand-alone...
 So, my plans were to use it only when requested -- i.e. keep the main file around, generate thumbnails and previews, and then if the user wanted, they could go to the item page, click a "Edit picture" button or something, and have the choice to (1) rotate the picture (and related thumbnail and preview), (2) resize and/or crop the picture, (3) crop the thumbnail or preview based on the stored picture.
 I'm NOT very good at implementing good UI (it always takes me weeks to do that when others could do it in days), so at that point it became a low-priority item, even though it was officially high-priority. It's mainly because of UX (user experience), which I wanted to be 'perfect'.
Facebook does a good job of this when upload using the "create photo album" feature.

(http://wedge.org/pub/feats/7508/very-cool-thumbnail-generation/do/dlattach/?attach=3836;image)
I've attached a screen shot, but you can see it shows a large-ish preview that can name, add a description, add geotagging, add individual photo descriptions, add tags, and set the read access permissions. This would be a great place to add Jcrop style selection of the thumbnails, it would be especially easy if the thumbnail size was selected at the top along with the album name. Then thumbnailing would be as quick as dragging open a box on each preview (as seen in the 150x150 fixed ratio thumbnail selection in the Jcrop demo(http://deepliquid.com/projects/Jcrop/demos.php?demo=live_crop)).  There's a real benefit to adopting a UI that's similar to facebook's UI, not only do you get the benefit from their design refinements, but the users are already know how to use it!
Quote from Nao on July 9th, 2012, 10:12 AM
Now, I'm still considering dropping attachments altogether from Wedge, and using AeMe instead. But first of all I'll need to fix some bugs (and even before that, try to spot them all), then work on a parallel implement of attachments vs uploads, and finally get rid of the attachment system and have someone develop a converter (or do it myself within Wedge...)
I'm not sure exactly how that would work, but AeMe is integrated into wedge, and I can see where its a bit redundant to have both. Why not make the attachment button in the post editor pop up a "create photo album" dialog to create a new AeMe album?
Quote from Nao on July 9th, 2012, 10:12 AM
It's not an easy task, let me tell you. And it's not helpful that none of us is being paid for it...
I've got some thoughts on this, but maybe it would be best to take this part of the discussion offline. Send me a PM if you'd like to talk about this.
Quote from Nao on July 9th, 2012, 10:12 AM
Quote
The other thing I've been thinking Jcrop would be useful for is an intermediate sized "preview" image. A smaller subsection of the full image that could be used for an inline preview within the text of a post.
That is already 'done' in my mind.
 As a reminder, AeMe has pictures (limited size but usually large), previews (usually 600x400 or something, for use on item pages) and thumbnails (usually 150x100 or something, for use on album pages). Depending on the type of preview (site homepage or blog), I'd automatically attach the thumbnail (on the left of the text preview) or preview (on top of the text preview, or in a carousel for instance).
 
 Don't believe that just because it isn't in Wedge yet, I haven't thought about it a lot already ;)
 Just check out http://nao.noisen.com(http://nao.noisen.com/) for an example of how I want Wedge blogs to look like. And ideally I want to simply take the first graphic element in each post, get their thumbnail and offer this as post preview in smaller post lists. (eg site homepage, of which I currently have no example for you, except on sites I'm not related to.)
I really think the blog view you've implemented for noisen.com is beautiful. I'll leave it in your capable hands! ;)