-
Notifications
You must be signed in to change notification settings - Fork 195
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
Allows multiple derivative types. #638
base: master
Are you sure you want to change the base?
Conversation
Hi, The Travis test succeeds on php 5.2 but not above because there is a new version of PHPUnit that made deprecated some old code. Nevertheless, the patch works fine (like for other pull requests). Sincerely, Daniel Berthereau |
791300e
to
11845df
Compare
Hi, This structure is not common, but this is allowed since switch does a loose comparison, so if As it's not a common way, I replace the case by: // Manage uri for derivatives.
if (substr($property, -4) == '_uri') {
$type = substr($property, 0, -4);
if (isset($this->_pathsByType[$type])) {
return $this->getWebPath($type);
}
} I rebased it too in order to check the Travis test. Sincerely, Daniel Berthereau |
Hi, Travis test is ok! Sincerely, Daniel Berthereau |
11845df
to
d646707
Compare
Hi, The patch has been fixed, so do you think it's a good idea to allow multiple derivatives? Sincerely, Daniel Berthereau |
I think the idea of adding extra derviatives is fine, and most of how this accomplishes that looks pretty good. What I'd like to see though, is the configuration file settings only adding to the set of derivatives we have now. I foresee a lot of potential trouble when users mix this with the existing themes and plugins (and pieces of the core) that assume that "thumbnail", "square_thumbnail", and "fullsize" are available. I see the intent is to let them be moved around, but I think as-is this setup makes it too easy for a mistaken edit to the config file to break things. |
Hi, I commit a patch to set default derivatives types automatically. Sincerely, Daniel Berthereau |
1b27e62
to
c1e92e5
Compare
c1e92e5
to
a923117
Compare
Hi, The branch has been rebased on v2.5. Sincerely, Daniel Berthereau |
Hi,
For a project, I need other derivative types than "fullsize", "thumbnail" and "square_thumbnail". In particular, I need mini square thumbnails to build a pretty view and another type between "fullsize" and "original" for a site with big images.
So this little patch allows that. A plugin example is available at https://gist.github.com/Daniel-KM/b91f7f94182e50538149.
Sincerely,
Daniel Berthereau
Infodoc & Knowledge management