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

Gallery Name Creating Large Templates #72

Closed
sklum opened this issue Jul 23, 2013 · 14 comments
Closed

Gallery Name Creating Large Templates #72

sklum opened this issue Jul 23, 2013 · 14 comments
Assignees

Comments

@sklum
Copy link
Member

sklum commented Jul 23, 2013

If you enroll a large number of files (e.g. using a wildcard within a folder), the name for the gallery will be every file you enrolled. This makes template size potentially massive. Right now, a simple workaround is to use the Retain transform to only keep certain metadata (not Gallery) but that shouldn't be necessary.

@ghost ghost assigned sklum Jul 23, 2013
@jklontz
Copy link
Member

jklontz commented Jul 24, 2013

If you enroll from a folder, the command should look like br -enroll /path/to/folder, which will recursively enroll all files in the folder, instead of br -enroll /path/to/folder/* which the shell will expand to a long file list as you've discovered :). If you need to filter your files, a regexp can be specified: br -enroll /path/to/folder(*.jpg) -- see the implementation in EmptyGallery as this syntax of the regexp I provided may be slightly wrong.

@jklontz jklontz closed this as completed Jul 24, 2013
@sklum
Copy link
Member Author

sklum commented Jul 25, 2013

I'm not thrilled with this response - having every file name appended to the Gallery metadata field in this situation is incorrect.

@jklontz
Copy link
Member

jklontz commented Jul 25, 2013

I'm open to alternatives, but no elegant ones immediately come to mind for me.

@sklum
Copy link
Member Author

sklum commented Jul 25, 2013

That's why I opened an issue?

@jklontz jklontz reopened this Jul 25, 2013
@jklontz
Copy link
Member

jklontz commented Jul 25, 2013

K, one suggestion would be to name the gallery after the first and last file in the list. I'm not sure how easy that is to implement though -- I haven't looked at that part of the code in a while though. Another alternative is to detect really long gallery names, and then store an MD5 hash of the name in these cases. I think I'm leaning in favor of the hashing approach...

@sklum
Copy link
Member Author

sklum commented Jul 25, 2013

Hashing seems reasonable. Anything above 64 characters?

@jklontz
Copy link
Member

jklontz commented Jul 25, 2013

Works for me -- I don't think gallery name is used that often anyway.

@lbestrowden
Copy link
Contributor

I need to enroll a folder of files and filter them so only jpeg files are enrolled. -enroll path/to/folder/*.jpg works from the shell, but I need to do this from within the YouTube plugin with a list of arguments to execute. Is there a regular expression that can also be used in this case (not from the shell)?

@jklontz
Copy link
Member

jklontz commented Jul 29, 2013

@lbestrowden Yes, see my first comment. br -enroll '/path/to/folder(*.jpg)' will avoid shell interpretation and be handled within OpenBR. For details, see EmptyGallery in gallery.cpp, in this case EmptyGallery::regexp = *.jpg.

@lbestrowden
Copy link
Contributor

The correct syntax ended up being br -enroll '/path/to/folder[regexp=jpg]'. EmptyGallery uses EmptyGallery::regexp to match the suffix of the filenames. Is this the desired functionality, as it's not able to match an arbitrary regular expression?

@jklontz
Copy link
Member

jklontz commented Aug 1, 2013

Lacey, please feel free to submit a fix -- desired functionality is
dictated by actual encountered needs :)

On Thu, Aug 1, 2013 at 12:52 PM, lbestrowden notifications@github.comwrote:

The correct syntax ended up being br -enroll '/path/to/folder[regexp=jpg].
EmptyGallery uses EmptyGallery::regexp to match the suffix of the
filenames. Is this the desired functionality, as it's not able to match an
arbitrary regular expression?


Reply to this email directly or view it on GitHubhttps://github.com//issues/72#issuecomment-21951739
.

@lbestrowden
Copy link
Contributor

Ok, will do at some point. For my current purposes, matching the suffix is sufficient... say that 5 times fast. :)

@sklum
Copy link
Member Author

sklum commented Aug 1, 2013

Made the change in fa4557b.

@jklontz
Copy link
Member

jklontz commented Oct 3, 2013

Just saw this message, so this can be closed now?

@jklontz jklontz closed this as completed Oct 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants