我已经上传了blueimp文件。我试着制造更多的image_versions。第一个和最后一个image_version确实可以工作。在我的例子“”,“小”和“缩略图”工作,另一个不起作用。在另一个image_versions中,图像将被上传,但不会调整到合适的大小。
这是我的代码片段:
'image_versions' => array(
// The empty image version key defines options for the original image:
'' => array(
// Automatically rotate images based on EXIF meta data:
'auto_orient' => true
),
'small' => array(
'max_width' => 150,
'max_height' => 150
),
'medium' => array(
'max_width' => 200,
'max_height' => 200
),
'large' => array(
'max_width' => 400,
'max_height' => 400
),
'xlarge' => array(
'max_width' => 600,
'max_height' => 600
),
'square' => array(
'crop' => true,
'max_width' => 300,
'max_height' => 300
),
'thumbnail' => array(
'max_width' => 100,
'max_height' => 100
)
)发布于 2015-02-05 17:52:52
我只是碰到了同样的问题。在深入研究代码之后,我发现当它循环遍历图像版本时,它将结果图像对象保存在缓存中。所以在处理“小”之后..。结果图像对象( 150 X 150 )的缓存版本被称为文件。
因此,源文件被简单地复制到中、大型、xlarge和square,因为代码认为图像是150 x 150。然而,缩略图被处理,因为它小于150 x 150。
为了解决这个问题,您可以将no_cache选项添加到映像版本中--这会降低代码的效率,但也解决了您的(和我的)问题。
所以您的代码将如下所示:
'image_versions' => array(
// The empty image version key defines options for the original image:
'' => array(
// Automatically rotate images based on EXIF meta data:
'auto_orient' => true
),
'small' => array(
'max_width' => 150,
'max_height' => 150,
'no_cache' => true
),
'medium' => array(
'max_width' => 200,
'max_height' => 200,
'no_cache' => true
),
'large' => array(
'max_width' => 400,
'max_height' => 400,
'no_cache' => true
),
'xlarge' => array(
'max_width' => 600,
'max_height' => 600,
'no_cache' => true
),
'square' => array(
'crop' => true,
'max_width' => 300,
'max_height' => 300,
'no_cache' => true
),
'thumbnail' => array(
'max_width' => 100,
'max_height' => 100,
'no_cache' => true
)
)https://stackoverflow.com/questions/27968015
复制相似问题