Skip to content

Commit

Permalink
use new pre scale parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTango committed May 16, 2022
1 parent 0ba15c7 commit 7528e72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plone/outputfilters/filters/resolveuid_and_caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def __call__(self, data):
srcs = [src.strip().split() for src in srcset.strip().split(',') if src.strip()]
for idx, elm in enumerate(srcs):
image_url = elm[0]
src = self.resolve_scale_data(image_url)
image, fullimage, src, description = self.resolve_image(image_url)
srcs[idx][0] = src
attributes['srcset'] = ','.join(' '.join(src) for src in srcs)
for elem in soup.find_all(['source', 'iframe', 'audio', 'video']):
Expand Down Expand Up @@ -237,7 +237,7 @@ def resolve_scale_data(self, url):
scale_name = url_parts[-1]
obj, subpath, appendix = self.resolve_link(url)
scale_view = obj.unrestrictedTraverse('@@images', None)
return scale_view.url(field=field_name, scale=scale_name)
return scale_view.scale(field_name, scale_name, pre=True)

def resolve_link(self, href):
obj = None
Expand Down Expand Up @@ -280,9 +280,9 @@ def traversal_stack(base, path):
try:
if hasattr(aq_base(obj), 'scale'):
if components:
child = obj.url(child_id, components.pop())
child = obj.scale(child_id, components.pop(), pre=True)
else:
child = obj.url(child_id)
child = obj.scale(child_id, pre=True)
else:
# Do not use restrictedTraverse here; the path to the
# image may lead over containers that lack the View
Expand Down

0 comments on commit 7528e72

Please sign in to comment.