[Neos] TYPO3.Media viewhelper not cropping if property maximumWidth is set

Jan-Erik Revsbech janerik at moc.net
Sun Oct 13 17:20:49 CEST 2013


Ok. Then I won't make a fix, I can easily work around it with my own 
ImageViewHelper until then.

Regards
Jan-Erik Revsbech
MOC

> ------------------------------------------------------------------------
>
> 	Robert Lemke <mailto:robert at typo3.org>
> October 13, 2013 5:05 PM
>
>
> Hey Jan-Erik,
>
>
> I am working on a heavily refactored media management at the moment,
> which also includes a new way to manage thumbnails. So I guess that once
> it's done, the bug you found also will be solved.
>
> See: https://review.typo3.org/#/c/24484/
>
> Cheers,
> Robert
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
> ------------------------------------------------------------------------
>
> 	Jan-Erik Revsbech <mailto:janerik at moc.net>
> October 12, 2013 8:31 AM
>
>
> Hi awesome Neos developers and users. Working on a new Neos site I 
> experience a problem with the builtin Media viewhelper. In a custom 
> Element (nodetype) I specify an imagenode and render it with
>
> <media:image image="{image}" alt="My image image"  maximumWidth="200" />
>
> But cropping given in the Neos image inspector is not respected when 
> the maximumWidth attribute is set! This happens because the viewhelper 
> is i handed a "ImageVariant" domain model, and if the maximumWidth is 
> set (and is less than the images width and allowUpScale is FALSE) then 
> the getThumbnail method og the ImageVariant is called.
> For ImageVarians, this method is correctly documented as "Creates a 
> thumbnail of the original image" and thus is forgets all about the 
> variants ProcessingInstructions which are needed for the cropping.
>
> I think this is a bug. The easyest way to reproduce it is setting the 
> following TypoScript
>
> prototype(TYPO3.Neos.NodeTypes:Image).maximumImage = 200
>
> (default is 2560)
>
> and then insert a Image content element, crop it with the very cool 
> Image Inspector, and watch how the cropping is not in effect any longer.
>
> Can any other confirm this behaviour, and that is it undesired?
>
> If this is a bug, then I suggest either of these solutions:
>
> 1: Change the viewhelper, to be aware of ImageVarians, and if an 
> ImageVariant is given, then add the new transformations, instead of 
> creating a new ImageVarians
> 2: Change the viewhelper to not actually use Thumbnails, but do a 
> scale transformations directly using a 
> \TYPO3\Media\Domain\Service\ImageService
> 3: Change the behaviour of the getThumbnail method on the ImageVariant 
> (this will probably have sideeffects)
> 4: Add a new method that generates a thumbnail that respects the 
> exising transformations on the ImageVariant.
>
> In my oppinoin, option 2 is the most clean.
> I will create the patchset if any other can confirm the problem and we 
> can agree on the correct solution.
>
> I'm running alpha 5 and, I'm aware that a lot happened the last week, 
> but from what I can see in the Gitlog, this is not changed.
>
> Regards
> Jan-Erik Revsbech
> MOC
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos


More information about the Neos mailing list