问题描述
如果我进入Typo3后端的Filelist
并选中显示缩略图的选项,则只会看到损坏的图像链接.
If I go to Filelist
in the Typo3 backend and check the option to display thumbnails, I only see broken image links.
但是我记得缩略图在某些时候显示正常.
Yet I remember that the thumbnails displayed ok at some point.
在拼写错误的安装工具中对ImageMagick进行的测试表明,ImageMagick可以正常工作.
A test of ImageMagick in the install tool of typo shows, that ImageMagick is working ok.
该怎么办?
推荐答案
这不仅是RealURL的问题-尽管在用户手动操作此文件以添加自定义规则时这是最常见的问题.无论如何,typo3conf/localconf.php
也会出现此问题.
It's not only RealURL's problem - although it's most common while users are manipulating this file manually to add custom rules. Anyway this problem also ocures with typo3conf/localconf.php
.
如何确认:
右键单击破碎的图像,然后选择Open image in new window
,它将打开一个文件,其地址如下:http://somedomain.tld/typo3/thumbs.php?&file=..%2Fuploads%2...etc
使用某些浏览器预览源代码,即. Chrome中的地址以view-source:
开头,例如:view-source:http://somedomain.tld/typo3/thumbs.php?&file=...etc
.图片代码之前不应有空格...
Right click on the broken image and choose Open image in new window
it will open a file with address like: http://somedomain.tld/typo3/thumbs.php?&file=..%2Fuploads%2...etc
use some browser to preview the source code ie. in Chrome prepend the address with view-source:
like: view-source:http://somedomain.tld/typo3/thumbs.php?&file=...etc
. There should not be any whitespaces before the code of image...
如何预防?
如您所写.检查您的配置文件,例如realurl_conf.php
或localconf.php
,并确保<?php
之前没有空格.如果脚本结束....只需删除标签,所以脚本将自动结束而没有空格(即使您将在最后一行代码之后添加100个空行),也很不幸有时在配置中发现这一烦人的空间需要花费数小时,所以....
As you wrote. Check your config files like realurl_conf.php
or localconf.php
and make sure that there are no spaces before <?php
. In case of script ending.... just remove the ?>
tag, so script will end automatically without white spaces (even if you'll add 100 empty lines after last line of code), unfortunately sometimes finding this one annoying space in configs takes hours, so....
如何永久修复?
我很惊讶,尽管这些年来仍然没有解决,但是,编辑文件:t3lib/thumbs.php
,在开头(即,在php标签之后)添加行:
I'm surprised, that isn't fixed after all these years still, while it's quite easy with ob_end_clean(), edit file: t3lib/thumbs.php
, at the beginning (ie. right after php tag) add line:
<?php
ob_start();
接下来找到main()
方法,在其开始行添加用于清理输出缓冲区的方法,该方法将删除其他文件中包含的所有垃圾:
Next find main()
method, add at its begining line for cleaning output buffer, which will remove all garbage included from other files:
function main() {
ob_end_clean(); //here
...
Voila!
这篇关于我再也看不到后端的图像缩略图.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!