未识别主题的图像格式

时间:2015-12-30 13:57:25

标签: sulu

我想为我的主题添加缩略图设置。 我现在正在使用默认主题。

主题配置中已有一个image-formats.xml。

<?xml version="1.0" encoding="UTF-8"?>
<formats xmlns="http://schemas.sulu.io/media/formats"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://schemas.sulu.io/media/formats http://schemas.sulu.io/media/formats-1.0.xsd">
    <format>
        <name>640x480</name>
        <commands>
            <command>
                <action>resize</action>
                <parameters>
                    <parameter name="x">640</parameter>
                    <parameter name="y">480</parameter>
                </parameters>
            </command>
        </commands>
    </format>
    <format>
        <name>1200x</name>
        <commands>
            <command>
                <action>scale</action>
                <parameters>
                    <parameter name="x">1200</parameter>
                </parameters>
            </command>
        </commands>
    </format>
</formats>

相应的配置如下:

# LIIP Theme Configuration
liip_theme:
    themes: ["default"]
    active_theme: "default"
    load_controllers: false

如果我将图像转储到我的资源中,则不会显示新格式(1200x)。 我试图重新加载配置并清除缓存。我还清除了web / uploads / media文件夹。

它还能做什么?

以下是模板中图像的转储。 如你所见,我自己的格式没有出现。

Media {#2167 ▼
  #url: "/media/12/download/1.png?v=1"
  #formats: array:10 [▼
    "400x400" => "/uploads/media/400x400/02/12-1.png?v=1"
    "400x400-inset" => "/uploads/media/400x400-inset/02/12-1.png?v=1"
    "200x200" => "/uploads/media/200x200/02/12-1.png?v=1"
    "190x" => "/uploads/media/190x/02/12-1.png?v=1"
    "170x170" => "/uploads/media/170x170/02/12-1.png?v=1"
    "150x100" => "/uploads/media/150x100/02/12-1.png?v=1"
    "100x100" => "/uploads/media/100x100/02/12-1.png?v=1"
    "100x100-inset" => "/uploads/media/100x100-inset/02/12-1.png?v=1"
    "50x50" => "/uploads/media/50x50/02/12-1.png?v=1"
    "640x480" => "/uploads/media/640x480/02/12-1.png?v=1"
  ]
  #locale: "de"
  #version: null
  #additionalVersionData: array:1 [▶]
  #fileVersion: FileVersion {#2754 ▶}
  #file: File {#2751 ▶}
  #entity: Media {#2748 ▶}
}
FileVersionMeta {#2759 ▼
  -id: 12
  -title: "1"
  -description: null
  -copyright: null
  -locale: "de"
  -fileVersion: FileVersion {#2754 ▼
    -name: "1.png"
    -version: 1
    -size: 105564
    -mimeType: "image/png"
    -storageOptions: "{"segment":"04","fileName":"1.png"}"
    -storageType: null
    -downloadCounter: 0
    -created: DateTime {#2742 ▶}
    -changed: DateTime {#2743 ▶}
    -id: 12
    -contentLanguages: PersistentCollection {#2761 ▶}
    -publishLanguages: PersistentCollection {#2763 ▶}
    -meta: PersistentCollection {#2758 ▶}
    -file: File {#2751 ▶}
    -tags: PersistentCollection {#2756 ▶}
    -changer: User {#2430 ▶ …2}
    -creator: User {#2430 ▶ …2}
    -defaultMeta: FileVersionMeta {#2759}
    -properties: "[]"
  }
}

2 个答案:

答案 0 :(得分:0)

似乎存在缓存问题。我已经删除了缓存文件夹,但它没有用。我重新启动了我的VM,现在它可以工作了。 Semms对我来说是一个问题: - )

答案 1 :(得分:0)

图像格式通过sulu_media.image.formats参数中的编译器传递存储在容器中。添加新图像格式时,需要对两个内核进行缓存删除。

app/console cache:clear -e yourenvironment
app/webconsole cache:clear -e yourenvironment