Project

General

Profile

Feature #8747

new sharing platform for dt styles

Added by Simon Spannagel over 7 years ago. Updated almost 5 years ago.

Status:
Fixed
Priority:
Low
Start date:
12/08/2013
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)

Description

Look into how to setup a cool web2.0 platform for styles sharing with rating, gallery and so on (maybe support GHNS at some point?)

darktable-styles-platform-0.2.tar.gz (1 MB) darktable-styles-platform-0.2.tar.gz Source code Robert Rosman, 02/10/2013 08:26 PM
darktable-styles-platform-0.3.tar.gz (1 MB) darktable-styles-platform-0.3.tar.gz Robert Rosman, 02/11/2013 07:48 PM

Subtasks

darktable - Feature #9715: Style previewsClosed: won't fix


Related issues

Related to darktable - Feature #9239: Upload styles to website in lighttable modeTriaged02/04/2013

History

#1 Updated by Simon Spannagel about 7 years ago

  • Priority changed from Medium to Low

needs some time and rethinking...
Not running with any priority.

#2 Updated by Tobias Ellinghaus about 7 years ago

  • % Done changed from 0 to 20
  • Status changed from New to Triaged

#3 Updated by Robert Rosman almost 7 years ago

I'm a little interested in setting this up. I don't think it has to be that hard, and I have quite some experience of PHP, MySQL etc. I think we should avoid the need of creating accounts for downloading, uploading and rating different styles. The easier the better.

  • Rating: Could be done with a plugin like GD Star Rating to avoid having accounts. It's only allowing one rating per ip address.
  • Gallery: We could easily integrate the flickr API and show all images tagged with the specific style. The flickr export module in darktable could easily add tags when styles are applied, and name them like "darktable-style-highcontrast" for the style "highcontrast". The rest is easy peasy.
  • Uploading: I think the best approach would be to upload styles right inside darktable. Together with each style some metadata (like author, description etc.) and before/after images are sent. I've created a separate issue #9239 for this.

#4 Updated by Robert Rosman almost 7 years ago

Alright, I've done some initial work on the platform. It's browsable at http://darktablestyles.sourceforge.net/. It might not have web2.0 in mind, but rather consistency with the rest of the website. I'm not sure what you think about adding extra stuff in the left column and changing behaviour of the left thumbnails (try hovering and clicking on them)?

So far this is only a mockup, so no underlying database etc. I'm, not very familiar with Wordpress, but as far as I see, it would be possible to add every style as a new post in a category called "styles", and they would only be accessible through the styles platform, right? The images and dtstyle files will end up in some given path structure, but not necessarily accessible from the Wordpress panel.

The source code can be found here: https://sourceforge.net/projects/darktablestyles/files/latest/download?source=files

Well I'm not really sure where to go from here, What do you think so far?

#5 Updated by Simon Spannagel almost 7 years ago

  • % Done changed from 20 to 50
  • Status changed from Triaged to In Progress

Wow, Robert, nice work!

I like the idea of a close integration into the dt website. I don't think we need tons of web2.0 with sharing and whatsoever, let's better keep it simple and usable :) (since none of the team is very keen on that anyway...)

Design-wise: I like it very much, beside some minor things:
  • The download button doesn't fit to the style of the rest. maybe just a textlink? the position is good imho.
  • Maybe we should stick to the darktable rating stars from the application UI? They should fit better to the overall design
  • I like the hover thin in the overview, but maybe it would be better to really show both images in the detailed view for one style (not a strong opinion though...)
Code-wise: I'd rather have it as separate Wordpress plugin than as a post. This has several reasons:
  • it would pollute the posts overview in the backend which is quite useful to keep track of news and blog entries
  • more serious: we would have to work around permissions, since everyone allowed to write a new post (so styles uploader) would be able to write other posts, too. The permissions are not that finegrained.
  • we would probably pollute the posts database table since quite some additional fields (=infos like filename and thumbs etc) are needed. This is possible in theory but not really nice.
    This would all be solved using a separate wordpress plugin, or, if that is easier, just load the Worpdress header and footer which provides the navigation and the design css (this is how we currently do it with the user manual)

what are your thoughts?

Simon

#6 Updated by Robert Rosman almost 7 years ago

Glad you like it :)

The download button and rating stars where only to get an idea of the layout, but I agree that they don't fit the rest of the style. Very good idea with reusing the darktable stars, I didn't even think of that!

I see what you mean with separate images in the detailed view. I got so inspired by http://www.lightroompresets.com/ so I kind of implemented it all over the place. I'm open for changes here too.

My first thought was to create it separate from the Wordpress blog, but the reason I changed my mind was that I really like the comment plugin for blog posts, and GD star rating is also (as far as I understand) integrated with the blog. However, the reasons you listed makes perfect sense, and I even like it, that's giving me more flexibility. I would actually prefer the user manual way, unless I find some way to integrate the comment and rating system the other way around.

#7 Updated by Simon Spannagel almost 7 years ago

I think the mentioned functionality should be easy to integrate once you implement it as a plugin, since they are core components (at least the comments). The kickoff page for Wp plugins is here https://codex.wordpress.org/Writing_a_Plugin and we always deploy the latest stable version of Wp.

#8 Updated by Robert Rosman almost 7 years ago

Thanks I'll take look at it!

#9 Updated by Ivan Tarozzi almost 7 years ago

WOW!
I like Robert work and I found this feature really interesting.

I'm not a wordpress expert so I can't talk about development side.
As future user of style feature just one thing:

I think could be useful to create an automatic gallery of images loaded with the style.
When will have a lot of styles, instead to open or scroll style pages, it could be more easy to consult a grid page (like google images results) to have a global view (possibly with filter based on name or keywords?) and then link to selected style.

... but I don't know if this is easy to implement :)

#10 Updated by Robert Rosman almost 7 years ago

Thanks a lot Ivan :)

I'm not sure what you mean with the automatic gallery, that's what I tried to achieve with the linking to Flickr slideshow, see the section "In action" here: http://darktablestyles.sourceforge.net/show-style.php

It could be even better, this was the simplest way I could find at the moment.

I've also thought about a grid instead, that'll definitely be better when the collection grows. I've also thought a little about filtering, and I think in the first phase, we could at least sort the filters by rating, popularity, name, date, author and modules. Later on we might want to add keywords and search options.

I like your ideas, and if you come up with more, please let me know!

#11 Updated by Simon Spannagel almost 7 years ago

your localhost link does (obviously) not work. :)

#12 Updated by Robert Rosman almost 7 years ago

Haha sorry about that, I've updated the link above.

BTW Simon, is there any change to get some sort of permissions to log in to the existing wordpress dashboard, to have a look at how things are set up more in detail?

#13 Updated by Simon Spannagel almost 7 years ago

Hi Robert,

I created a user for you, you should receive the credentials by mail. However, I'm not really sure how useful this is since the user is running only with Contributor permissions. Usually installing a local Wordpress shouldn't be too much hassle (see: https://help.ubuntu.com/community/WordPress)

Cheers,
Simon

#14 Updated by Robert Rosman almost 7 years ago

Thanks Simon! I suppose you're right, I'll set up a local Wordpress and try to create a plugin over there.

#15 Updated by Ivan Tarozzi almost 7 years ago

Robert Rosman wrote:

Thanks a lot Ivan :)

I'm not sure what you mean with the automatic gallery, that's what I tried to achieve with the linking to Flickr slideshow, see the section "In action" here: http://darktablestyles.sourceforge.net/show-style.php

Hi Robert,
I saw current slideshow, but it is inside the style page.

I think about a gallery (grid or slideshow no matter now) to display all the images of all the styles.
Let's say a level above the current. As alternative way to browse styles (by images instead of by name and description).

just my2c

#16 Updated by Robert Rosman almost 7 years ago

Oh now I see! Interesting approach. This might be more relevant further down the road. I appreciate your two cents :)

#17 Updated by Tobias Ellinghaus almost 7 years ago

Why do you want to fiddle with wordpress? I would rather create a stand alone application that just shares the look with our current website. That way we can still use it once we move away from wordpress.

#18 Updated by Robert Rosman almost 7 years ago

Oh I didn't know there were any plans to move away from wordpress. I really like the comment form and it would probably be pretty easy to integrate a star rating system for the styles if we'd go with a wordpress plugin. However I'll create this platform separately from wordpress at this stage, (without comments or rating), and possible later on convert it to a wordpress plugin.

#19 Updated by Mikko Ruohola almost 7 years ago

I was thinking about something like too. But I would have gone with Ruby app. Well, I've grown to hate PHP ;)

I like the integration to wordpress part, but I don't think it's needed, because like user manual, this too can be a separate "program".

Now all the irc people can start raving about RubyOnRails problems that we've had, but I think this would be a lot smaller program to run and with JSON interfaces to styles, they could be integrated quite easily to the GUI of the darktable.. Right? ;)

#20 Updated by Robert Rosman almost 7 years ago

Hi Mikko!

As for me I wouldn't go with ruby, since I'm much more familiar with PHP, and I think It's more consistent (especially with its c-like syntax).

I can't speak for which way to go with JSON integration, but I don't see a problem with doing it in PHP.

I guess bottom line would be that I'm not having anything against ruby, but I've already begun the job in PHP and I can't really see the big benefits in switching over. For me personally it would mean more hassle and studies.

#21 Updated by Robert Rosman almost 7 years ago

Alright folks, I'm getting satisfied with the results. Now it's possible to view, download, sort, rate, upload and edit styles. As usual, you can go to http://darktablestyles.sourceforge.net/ and get a feeling for the outcome.

@Simon: I've attached the source code. In README I've tried to outline the process of integrating it to the real website. Feel free to make any changes to the code as it fits the needs.

There are yet some features to add, but first I'll get my hands on #9239.

#22 Updated by Simon Spannagel almost 7 years ago

Hi Robert,

sorry for the late response, I have been quite busy the weekend. Anyway:

I like what you have done so far! It's functional and blends in the website quite nicely. Some iterations might of course be needed concerning final usability and layout, but this should be rather simple to change then.

There are no plans to move away from wordpress. When I rebuilt the website some years ago I chose wp not only 'cause it came along but because it is well supported and has a broad user base. This means we can most likely rely on Wordpress updates being delivered. Since it is functional and suits our needs I don't see any need for a change - and I don't see anybody wanting to redesign everything. So in my humble opinion: I would encourage you to take advantage of the built-in functionality concerning rating and commenting.
If we really want to get rid of wp we can still re-implement that for ourselves.

I hopefully have time to look into your code tonight.
Concerning #9239 please make sure to join #darktable on freenode so we get a consensus with other devs before implementing another button in the UI (yes, even single buttons are being heavily discussed!) Maybe the majority prefers just to provide an upload form inside the catalogue.

Thinking of this, the latter one might actually be more consistent since you have to download them manually anyway, at least in your current design. Otherwise we would need even more functionality inside darktable - and part of the functions of dt would depend on the availability of a webserver. I'm not really convinced this would be a good idea.

So, as said, if you find the time come over to IRC!
best regards
Simon

#23 Updated by Robert Rosman almost 7 years ago

Uploading a new version (0.3) with redmine integration.
Decided on IRC:

  • Wait with wordpress integration
  • Do not allow deletion of styles (maybe a link with deletion request)
  • Do not allow updating styles

#24 Updated by Simon Spannagel almost 7 years ago

I read your code and tested a bit and it all looks fine. I have some remarks though:

  • We need some sort of breadcrumb at the top to be able to navigate back to the overview. Furthermore we might want to have these next/previous buttons for browsing just as in the articles: http://www.darktable.org/2012/12/profiling-sensor-and-photon-noise/
  • It bugs me a bit that (in overview) clicking the image and clicking the link does two different things. I would expect both to open the details page.
  • Do we really need the rating stars to be shown in the overview? I tend to not liking them there, not sure though. But for sure they should not be clickable there I think. Voting should go together with looking at it at least for a bit :)
  • Directly accessing redmine's database to check for the user credentials is a bit of a pain for me since this opens all ways for sql injections without careful checkings. (This might be another advantage of integration into wp, using its authentication method, or we find another safe way)

Just my 3 pesos. What's your opinion on this?
:)
Simon

#25 Updated by Simon Spannagel almost 7 years ago

and:

(22:37:04) kalven: hover effects doesn't work well on tablets

#26 Updated by Ivan Tarozzi almost 7 years ago

I don't know if my opinion is required, but here my 2euro :)

+1 on Simon notes, points 1 and 2

rating: I like to see stars in the overview page, but I agree they should be not clickable here.

Since in overview header we can sort by "rating, popular, newest, name, author" a solution could be to show all those information near the thumb; so:
- decrease the stars size
- show author and publication date (= newest) in small fonts
- show download count (= popular) in small fonts.

I know these are a lot of information, but when I apply sort I like to have a feedback

#27 Updated by Robert Rosman almost 7 years ago

Breadcrumb and navigation: Good point. In the link you pasted there is no such link back to the blog, and I think many people will simply hit the back button or possibly click on styles in the top navigation bar (I'd suggest under resources). It's a good idea to have previous and next links.

Clicking image: I've thought about it too, and I guess you're right. An option would be to add a small zoom icon besides the rating stars to show big images. I'm not sure how to do it in detailed view (show-style.php), do you think clicking the preview should open up big images or not?

Rating: I think I agree with Ivan, showable but not clickable.

SQL injection: I realize I never escaped $username and $password, but it seems like adding mysqli_real_escape_string() to both variables would be sufficient:
http://www.php.net/manual/en/security.database.sql-injection.php
http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-string

Hover: True, we should have that in mind. Maybe adding a toggle link to the description underneath big images in enough, or we can have some other technique for showing before/after images, please come with suggestions :)

More details: I think it'll become pretty much information if we'd show it all, but how about only showing the information relevant to sorting? So if you've chosen to display styles by newest, only publication date will be viewed underneath the rating, or author name if sorted by author, etc. The same thing could possibly apply to rating, if chosen to sort by rating the stars are shown, otherwise hidden.

How about that?

#28 Updated by Ivan Tarozzi almost 7 years ago

Robert Rosman wrote:

Hover: True, we should have that in mind. Maybe adding a toggle link to the description underneath big images in enough, or we can have some other technique for showing before/after images, please come with suggestions :)

I'm not a touch device user so I can't help :(
But, are we sure we need support touch? (I mean don't implement an interesting feature because touch doesn't support)
I think styles will be browsed and downloaded using the same PC where darktable runs, so may be only desktop/workstation/notebook.... or am I wrong?
Of course a better solution for touch also will be the better choice, but I haven't idea.

second option: since we will upload pre and post image, do you think is it possible to build in batch a single image like darktable snapshot? I mean side pre + side post and I'm thinking about tools as imagemagick or other.... but I admit my ignorance

More details: I think it'll become pretty much information if we'd show it all, but how about only showing the information relevant to sorting? So if you've chosen to display styles by newest, only publication date will be viewed underneath the rating, or author name if sorted by author, etc. The same thing could possibly apply to rating, if chosen to sort by rating the stars are shown, otherwise hidden.

Yes, this sounds as a good solution.

I admit I prefer to have multiple information (let's say: style name, stars, popular... other as optional). May be a layout with large images could helps; as example the flickr page:
http://www.flickr.com/explore

..... the hover question returns :)

#29 Updated by Robert Rosman almost 7 years ago

Ivan Tarozzi wrote:

But, are we sure we need support touch?

You're right. Maybe we should pay too much attention to them, but adding a toggle link wouldn't require too much, and make it more tablet friendly, so why not.

second option: since we will upload pre and post image, do you think is it possible to build in batch a single image like darktable snapshot? I mean side pre + side post and I'm thinking about tools as imagemagick or other.... but I admit my ignorance

Yes that is one possible option for sure. It could be cool, but let's say your style really comes out best on either side of the image, and that image isn't processed. (Hope that makes sense :)

I admit I prefer to have multiple information (let's say: style name, stars, popular... other as optional). May be a layout with large images could helps; as example the flickr page:
http://www.flickr.com/explore

I like the flickr style, and it's absolutely possible to implement for us too. We could also have a checkbox to check for more details, or display the information in a tooltip etc.

#30 Updated by Robert Rosman over 6 years ago

Alright, it might be in place with an update here. I've implemented some of the features we discussed above, such as:

  • Preventing SQL injection by being notorious with escaping SQL strings
  • Generating thumbnails online instead of inside dt. (The drawback is that the thumbs generated in dt are better, more accurate in all kind of ways)
  • Clicking thumbs leads to detailed view of the style
  • More details in overview, depending on how the styles are sorted
  • Won't allow users to rate in the overview, only displaying current rating

I've finally set up the files in a git repo, so no new archive. Look here instead: http://sourceforge.net/p/darktablestyles/git/

#31 Updated by Robert Rosman over 6 years ago

Suggestions have been implemented now.

  • Toggle button in lightbox, along with shortcut (t)
  • Links to previous/next/overview at the top
  • Show the real names of modules.
  • Some fixes for better interaction with dt

Think that would be it. Unless we really want to go convert it all to a Wordpress plugin, or you have further opinions, I'd call it "complete" (if there is such a thing in coding).

#32 Updated by Robert Rosman over 6 years ago

Now authenticating through redmine's rest api by using curl.

#33 Updated by Simon Spannagel over 6 years ago

Very nice. I think we could declare it working!

Since we are already in string and feature freeze for dt 1.2 the uploader won't make it in - but since there are already a couple of other things in the pipeline waiting for release it should be fine for 1.3.

#34 Updated by Robert Rosman over 6 years ago

That's some good news :) Do you think I should make the pull request for the uploader before or after the sharing platform is set up on the official website?

#35 Updated by Simon Spannagel over 6 years ago

Hi Robert,

since 1.2 is out the door I would like you to test again your uploader, rebase the branch and then file a pull request against current git master.

Cheers,
Simon

#36 Updated by Robert Rosman almost 6 years ago

Hi!

I've finally rebased and made a pull request (of #9239).

Best regards,
Robert

#37 Updated by Simon Spannagel almost 5 years ago

  • % Done changed from 50 to 100
  • Status changed from In Progress to Fixed

Also available in: Atom PDF

Go to top