Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guess tags by file name #515

Open
JarJak opened this issue Sep 20, 2015 · 16 comments
Open

guess tags by file name #515

JarJak opened this issue Sep 20, 2015 · 16 comments
Labels

Comments

@JarJak
Copy link
Contributor

JarJak commented Sep 20, 2015

when i upload file like funny_cat_photo.jpg i would like to get #funny #cat #photo tags to be suggested by default

@shish
Copy link
Owner

shish commented Sep 20, 2015

As far as I know there's no way to see the filename before the upload is complete; but if there is a way, this would be nice. Maaaybe the AJAX upload APIs have something? That would require replacing the whole upload process with an AJAX-based one, but that might actually make things a lot nicer (eg, start uploading the file as soon as it's selected, show the thumbnail alongside the enter-tags box)

(We could do the initial upload, and then show a second screen with "you've just uploaded this image, would you also like to add these tags to the image", but that seems messy both from a user and code standpoint)

@JarJak
Copy link
Contributor Author

JarJak commented Sep 20, 2015

Not really. Async upload and thumbnail generation is easy to implement since we have libraries like https://blueimp.github.io/jQuery-File-Upload/ + something like Symfony's Request http://symfony.com/doc/current/components/http_foundation/introduction.html

@JarJak
Copy link
Contributor Author

JarJak commented Sep 20, 2015

is there a way to create an extension for doing this? if so, i would create one.

@shish
Copy link
Owner

shish commented Sep 21, 2015

jQuery-file-upload looks wonderful -- If it can fall back to regular file uploads for people with no JS, it'd be great to improve the standard upload extension; if it needs to be very different, it should be possible to copy-paste ext/upload to ext/upload-js and work from there

@cyb-er
Copy link

cyb-er commented Sep 21, 2015

Just my humble opinion:
Would it be a nice option? - Yes.
But should it be by default? - No.
I think it could be a nice option but only as an optional option that you can turn on/off in board config or somewhere else by a user. A great deal, maybe most picture files on the Interweb has just number or some hash like string for its name. And most users save it as it is (not changing a name) and they upload it as it is as well. Having board spammed with tags like 1435245758681, 54522342, 134355554534, 7a6f0d122def9f31c40, A0X45F45 etc. etc. is not what most board owners would like I imagine.

@JarJak
Copy link
Contributor Author

JarJak commented Sep 21, 2015

@shish who has JS disabled nowadays?
@cyb-er of course it must be disable-able, i would think about it as an extension. Tag spam is a serious problem here, but how about the ability to use user-defined custom regexp, like:
(^[a-zA-Z]{3,}$)|(^(?:[a-zA-Z0-9]+[ _-]{1})+[a-zA-Z0-9]+$)

@shish
Copy link
Owner

shish commented Sep 22, 2015

who has JS disabled nowadays?

Not many people, but enough that whenever I accidentally break a no-JS fallback method it's rarely more than a day before I get complaints >_< Personally unless it's really easy to integrate both methods, I think I would just keep the existing upload as is, add the awesome new uploader alongside it, and then use modernizr's .js / .no-js CSS classes to decide which one to display.

don't automatically add junk tags

how about only adding tags which other images have already used?

@cyb-er
Copy link

cyb-er commented Sep 22, 2015

how about only adding tags which other images have already used?

That's a great idea, it would work I think.

@lisandro52
Copy link

how about only adding tags which other images have already used?

That sounds like a useful setting that should come turned on by default.
Some people (like me) are probably going to start a fresh gallery without any tag, and will populate it using the images' filename. In these cases, you can just uncheck the "Only add tags that already exist".

@JarJak
Copy link
Contributor Author

JarJak commented Sep 22, 2015

@lisandro52 agree
IMHO both features (auto-tagging and multiupload) can come as an extension, so if anyone would like to not use them (when you need no-JS fallback for example) then it can be turned off easily

@dali99
Copy link
Contributor

dali99 commented Sep 23, 2015

I would love to use the filename as a tag, even if i hasn't been used in other files on my personal shimmie, as my image names are dates and time the photo was taken.

@JarJak
Copy link
Contributor Author

JarJak commented Sep 24, 2015

@dali99 that's why there must be an option for being able to use custom regexp

@dali99
Copy link
Contributor

dali99 commented Sep 24, 2015

This should probably be added to the bulk uploader as well.

@DakuTree
Copy link
Collaborator

DakuTree commented Oct 7, 2015

A bit late to conversation, but I have a few thoughts to add to this.

Somewhat expanding on what @cyb-er said, another thing to think about when suggesting tags is what if the tag looks valid, but is a tag for something else entirely?
This is probably more of a case with bigger boards, where two things of the same name exist, so two seperate tags need to be created. (Example: "orange" & "orange_(fruit)")
Depending on if new users have upload permissions, this could lead to a lot of things being tagged incorrectly.
Even as an extension, it is something that should probably be opt-in rather than opt-out.

@JarJak: Problem with anything user-defined is there isn't really a place to set it, same goes to allowing the user to disable the feature entirely.
There is "currently" no user options page for it to go & having the option sit on the upload page seems like the wrong way of doing things.

As for multi-upload, I'm fairly sure that already exists in some form on the actual /upload page. Probably doesn't help that only the lite & danbooru themes link to it though :\

@JarJak
Copy link
Contributor Author

JarJak commented Oct 13, 2015

How about just putting additional JS layer on top of actual multi upload? It will replace regular mutli file form with its own form, but will send files and tags as regular form does and of course it will be no-JS compatible. So there would be no need to override DataUploadEvent, just pure JS.

@kurtr
Copy link

kurtr commented Aug 26, 2016

I know this comment is very late. I can't seem to see if your looking for a JavaScript or PHP solution. Let me know and I can provide a solution for either.

@shish shish added the Feature label Nov 5, 2018
@shish shish changed the title Feature: guess tags by file name guess tags by file name Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants