我在 Plone 中看不到 JPG 图像的缩略图
我将很多 JPG 和 PNG 图像放在一个文件夹中。该文件夹使用缩略图视图,但缩略图中仅显示 PNG 图像。我使用 Plone 4.1 使用一个非常简单的构建:
[buildout]
extends =
http://dist.plone.org:5021/release/4.1/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = user:pass
eggs =
Plone
然后我尝试旋转 JPG 图像,然后出现下一个错误:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.ATContentTypes.lib.imagetransform, line 205, in transformImage
Module PIL.Image, line 1676, in transpose
Module PIL.ImageFile, line 189, in load
Module PIL.Image, line 385, in _getdecoder
IOError: decoder jpeg not available
所以我尝试安装 libjpeg8 和 libjpeg8-dev (使用 apt-get 因为我正在使用 debian 6)。另外,我还更改了构建,为枕头蛋添加了适当的行:
[buildout]
extends =
http://dist.plone.org:5021/release/4.1/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = user:pass
eggs =
Plone
Pillow
现在显示了 JPEG 缩略图。
感谢您的帮助。一开始我对构建有点困惑。
I put a lot of images JPG and PNG in a folder. That folder was using the thumbnails view but only PNG images are showed in the thumbnails. I was using Plone 4.1 using a very simple buildout:
[buildout]
extends =
http://dist.plone.org:5021/release/4.1/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = user:pass
eggs =
Plone
Then I tried to rotate a JPG image and I got the next error:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.ATContentTypes.lib.imagetransform, line 205, in transformImage
Module PIL.Image, line 1676, in transpose
Module PIL.ImageFile, line 189, in load
Module PIL.Image, line 385, in _getdecoder
IOError: decoder jpeg not available
So I tried installing libjpeg8 and libjpeg8-dev (with apt-get because I'm working with debian 6). Also I changed the buildout adding the appropiate line for the Pillow egg:
[buildout]
extends =
http://dist.plone.org:5021/release/4.1/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = user:pass
eggs =
Plone
Pillow
And now the JPEG thumbnails are displayed.
Thanks for your help. I got a bit confused with buildout at beginning.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用哪个操作系统?你编译的 PIL 是否支持 JPEG?您大多遗漏了这些行周围的一些内容,因此请抓住您的 buildout.cfg 并添加如下内容:
尝试在另一个文件夹中再次运行构建(因此这是完全新鲜的),并尝试看看当它将 PILwoTk 编译为 JPEG 时您会得到什么支持工作,您应该看到类似这样的内容:
如果
JPEG support ok
不是您所得到的,您很可能(肯定)缺少 jpeg 开发标头。Which operating system are you using? Did you compile PIL with JPEG support? You are mostly missing something around those lines, so grab your buildout.cfg and add something like this:
Try running the buildout again in another folder (so that is completely fresh) and try to see what you get when it compiles PILwoTk, to JPEG support to work you should see something like this:
If
JPEG support ok
is not what you get, you are most likely (definitely) missing jpeg development headers.Plone 中的图像在上传过程中会调整大小。您以前上传的图像不会调整大小或旋转或其他任何原因,因为库不存在。现在你有了一个可以工作的 PIL/Pillow。重新上传图片就可以了。但您可以在 ZMI 中手动所有图像。访问 Portal_atct 并选择“图像比例”选项卡。然后重新创建。所有图像都会重新计算。这可以持续很长时间,具体取决于图像的数量。
Images in Plone are resized during upload. Your formerly uploaded images are not resized or rotated or whatever because the library wasn't there. Now you have a working PIL/Pillow. Re-upload the image and it will work. But you can all images manually in the ZMI. Visit portal_atct and choose the tab 'Image scales'. Then recreate. All images are recalculated. That can last long time depending on the amount of images.