简体   繁体   English

奏鸣曲媒体-不调整大小

[英]Sonata media - No resizing

I would like to know if that's possible to get an image with {% path %} or {% media %} in a twig template from sonata, without crop/resize ? 我想知道是否可以从奏鸣曲的树枝模板中获得带有{%path%}或{%media%}的图像,而无需裁剪/调整大小? It seems that it's required to specify a format, but I would like to keep the original size in some case. 似乎需要指定一种格式,但是在某些情况下我想保留原始大小。

I have the idea to make a resizer that does nothing for this problem, but is it possible to specify a resizer by context and not a resizer for a provider in all contexts please ? 我的想法是制作一个对此问题不执行任何操作的调整程序,但是是否可以按上下文指定调整程序,而不是在所有上下文中为提供程序指定调整程序? Because I need to use a resizer in some case, but not in all. 因为在某些情况下(但不是全部)我需要使用调整器。

If you want to display your uploaded image without resize / crop in twig you can do : 如果您想显示上传的图像而不会在树枝中调整大小/裁剪,则可以执行以下操作:

{% media media, 'reference' %}

More details in the documentation on how to use the twig helpers. 文档中有关如何使用树枝助手的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM