-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Call new pre_scale and get_or_generate from plone.scale. #113
Conversation
See branch pre-scale of plone.scale.
Only do this when pre=True, so when generating a tag. You can override the standard behavior by explicitly passing new boolean parameter include_srcset.
Show some versions of the image with different directions. Show stored scales. Add button for clearing the scales. Currently only works when the fieldname is 'image' and there is an actual image.
Avoids a weird undefined genericsetup:importStep in CMFCore/exportimport/configure.zcml
Otherwise the scale method thinks we only want the current actual image scale, and then the srcset info would be useless so it does not include it.
This shows we do not get the generated scale for the srcsets anymore.
Ready for review, but I need to fix tests in |
@mauritsvanrees i added a fix here and in plone.scale to prevent some errors the modified parameter was producing in some methods |
For example when adapting a Folder: ``` TypeError: http://localhost:8080/Plone/@@ajax-search Traceback (innermost last): Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents Module ZPublisher.WSGIPublisher, line 376, in publish_module Module ZPublisher.WSGIPublisher, line 271, in publish Module ZPublisher.mapply, line 85, in mapply Module ZPublisher.WSGIPublisher, line 68, in call_object Module Products.CMFPlone.browser.search, line 288, in __call__ Module Products.CMFPlone.browser.search, line 303, in get_image_tag Module plone.memoize.volatile, line 74, in replacement Module plone.namedfile.scaling, line 600, in tag Module plone.namedfile.scaling, line 582, in tag Module plone.namedfile.scaling, line 510, in scale Module plone.scale.storage, line 220, in pre_scale Module plone.namedfile.scaling, line 200, in get_original_value Module zope.component.hooks, line 135, in adapter_hook Module plone.dexterity.primary, line 24, in __init__ TypeError: ('Could not adapt', <Folder at /Plone/news>, <InterfaceClass plone.rfc822.interfaces.IPrimaryFieldInfo>) ```
This does actually return None in some cases.
@mauritsvanrees i started with the picture tag method and the refactoring of the needed code in plone.outputfilters. |
Added some fixes and examples, it should work now here and in outputfilters |
I added title and alt attributes to the picture method, as well as examples for it and added a changelog entry |
This does a very small start for fixing the tests.
This reverts commit cc1036c.
We do not have plone.base there. The picture method is not supported on 5.2, but it would be nice if the rest of the code still works. I think get_picture_variants is mocked away in all tests, and this helps us.
…und. When a template calls the picture method, it seems nicer to return a normal img tag in case of problems. This also helps for Plone 5.2.
…e.namedfile into pre-scale-picture-tag
…e.namedfile into pre-scale-picture-tag
I have merged the |
All green in combination with plone/plone.scale#57. |
I still had no chance to look at this but I fully trust you both :) |
See branch
pre-scale
of plone.scale, in plone/plone.scale#57.