52540[BUGFIX] If selected crop variant has empty area then try the 'default' crop variant
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 2
Review log 89
-
Christian Toffolo uploaded patch set 1 04/21/17, 07:53
-
TYPO3com voted on patch set 1 V +1 04/21/17, 08:06 Completed build in 12m 42s on Fri, 21 Apr, 10:06 AM Test Summary: 55782 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10828
-
Helmut Hummel commented on patch set 1 CR -1 05/02/17, 21:32
"default" is just an arbitrary crop variant id. it is neither required nor recommend to be used. the image viewhelpers delivered by the core should not implement such fallback logic. instead such logic should be implemented in own project specific view helpers if needed -
Benni Mack abandoned the change 03/01/18, 20:45
-
Christian Toffolo commented on patch set 1 06/05/18, 17:46
Maybe this patch is wrong because it consider a 'default' crop variant but I believe that the core image viewhelpers must implement a fallback logic. Let's suppose we have 4 variants (bootstrap_package case): default, medium, small, extrasmall. If the editor crops only the 'default' variant there's no way to make this crop to be used in every case (breakpoints). The editor instead is forced to crop and maintain all the 4 variants if (s)he wants that the default crop is valid for every breakpoint. This is inconvenient. P.S.: if you want, call the 'default' crop variant 'large' to exclude that arbitrary id, still there's no way to set a fallback and, again, IMHO that must be a core feature. -
Helmut Hummel commented on patch set 1 06/05/18, 19:12
I did not mean to say, that this area is feature complete. A lot of things could be done to cover more use cases than what can be covered (conveniently) right now. However the suggested change here, does not help much to improve the situation. The use case you have in mind is using this feature to crop all variants in the same way, which makes me ask, why there are different variants defined anyway? What you seem to need is the possibility to define a "global crop" for an image, which is a totally different use case, which would need a different UI to communicate this behavior to the editors. Otherwise they might wonder why an image is cropped in one variant, while the user interface shows that it is not. -
Christian Toffolo commented on patch set 1 06/05/18, 19:36
The use case is pretty common, probably I explained it badly. There are different variants to give editors the possibility to crop the image differently for different devices sizes. By instance editor could need a vertical cut for portrait smartphones and horizontal for large desktop and so on for other breakpoints. But also there could be the case where the editor wants to simply cut a picture the same way no matter the device. By instance there's a vertical picture but the editor wants it to be displayed square in a particular case and for every devices. This case is more common than the previous one but the previous one is needed to give more flexibility. Btw, I now agree that the suggested change does not help to improve the situation. There should be an option to set the fallback like: 'cropVariantsFallback' => 'extrasmall,small,medium,default' so when TYPO3 renders the 'extrasmall' variant, it checks if there's a crop, if not it checks 'small', if not 'medium' and so on. Or simply a switch: 'cropVariantsFallback' => true and TYPO3 checks the crop variants sorted by declaration order. -
Helmut Hummel commented on patch set 1 06/08/18, 11:36
> But also there could be the case where the editor wants to simply cut a picture the same way no matter the device Yeah, got it. That's a different use case though. > There should be an option to set the fallback like Could be one approach. However, this would also not cut it for all similar use cases. Especially it needs to be taken care that editors see a preview of the final results *before* it is rendered in frontend. What could be done: Implement image editing functionality on file level. This would enable editors to upload files and do some basic editing before it is used. Once it is used somewhere, the edited image is used as base and additional crop variants can be applied What also could be done is adding UI to apply crops for one variant to other variants. Ether one or all. Benefit: it is transparent for editors, they see the result instantly. It is one more click (or a few more), but still better than defining the crop area for all variants In any case, I suggest you create a forge ticket as feature request. because that is what it is. a feature, not a bugfix -
Christian Toffolo commented on patch set 1 09/19/18, 09:31
I created a forge ticket as feature request: https://forge.typo3.org/issues/86310