【发布时间】:2020-02-11 12:01:00
【问题描述】:
我们使用TYPO3 9.5.13、GraphicsMagick 1.3.29、Ghostscript 9.27、BK2K\\BootstrapPackage 11.0.1
将 PDF 用作普通图像没有问题。
但现在我想要一个完整列宽(~1000px)的 PDF 的“预览”。尽管 PDF 具有高分辨率,但生成的图像宽度仅为 595 像素,几乎无法读取任何文本。
问题出现在 Image-CE 中,例如上传 CE,我想对其进行增强:
每次我想要使用完整列宽的图像时,它都会以糟糕的分辨率呈现,并且图像似乎失真。
流体部分:
<img loading="lazy"
src="{f:uri.image(image: file, cropVariant: 'default', maxWidth: 1100)}"
width="{bk2k:lastImageInfo(property: 'width')}"
height="{bk2k:lastImageInfo(property: 'height')}"
intrinsicsize="{bk2k:lastImageInfo(property: 'width')}x{bk2k:lastImageInfo(property: 'height')}"
title="{file.properties.title}"
alt="{file.properties.alternative}">
结果如下:
<img loading="lazy"
src="/fileadmin/_processed_/3/2/csm_Warum_D-Arzt_6afd8ad8d4.png"
intrinsicsize="595x842"
title=""
alt=""
width="595"
height="842">
编辑:
如果使用此 FLUID:
<img loading="lazy"
src="{f:uri.image(image: file, cropVariant: 'default', width: 1100)}"
width="{bk2k:lastImageInfo(property: 'width')}"
height="{bk2k:lastImageInfo(property: 'height')}"
intrinsicsize="{bk2k:lastImageInfo(property: 'width')}x{bk2k:lastImageInfo(property: 'height')}"
title="{file.properties.title}"
alt="{file.properties.alternative}">
我明白了:
<img loading="lazy"
src="/fileadmin/_processed_/3/2/csm_Warum_D-Arzt_2ffb63b15f.png"
intrinsicsize="1100x1557"
title=""
alt=""
width="1100"
height="1557">
图像更大(并且溢出容器)但质量更差,请注意更大的像素:
【问题讨论】:
-
595?这听起来有点像在常量中定义了一个 maxwidth?
-
您使用的是标准 CE 吗? TS 设置中有一个 maxGalleryWidth=600。 595px 听起来有点像这些 600px 减去一些填充/边框/...
-
我使用 bootstrapPackage 中的 CE。我找不到任何设置
maxGalleryWidth或任何值595或600(颜色定义除外)。 -
我不知道引导程序包,所以我不能说,如果这是特定于该分机的东西。您可以在 TypoScript 对象浏览器中分析所有常量(选择模板模块,然后在上方下拉列表中选择 TypoScript 对象浏览器)。你会得到一个包含所有生效常量的列表。例如在 styles.content.textmedia 下设置的东西?另一种可能性:由于PDF没有像真实图像那样的图像尺寸,请尝试将maxWidth替换为宽度。
-
另一个想法:我在使用GIFBUILDER时遇到了类似的奇怪质量问题。解决方案是设置 ['GFX']['gdlib_png'] => true。如果在转换图像时没有此设置,它会被转换为 GIF(=质量差的图像)。
标签: pdf typo3 ghostscript graphicsmagick typo3-9.x