Qooxdoo 中的圆角 - ImageMagick 和 PNG 的问题

发布于 2024-09-06 02:44:18 字数 3388 浏览 3 评论 0原文

我想在 Qooxdoo 中创建一个带圆角的按钮,但遇到一些问题。我猜这是 ImageMagick 的问题,而不是我的 Qooxdoo 代码的问题,但无论如何我都会发布它。

因此,为了创建圆角,我遵循此指南

这是我的 image.json 包含的内容:

{
 "jobs" :
 {
  "common" :
  {
   "let" :
   {
    "RESPATH" : "source/resource/custom"
   },

   "cache" :
   {
    "compile" : "../cache"
   }
  },

  "image-clipping" :
  {
     "extend" : ["common"],

     "slice-images" :
     {
     "images" :
     {
     "${RESPATH}/image/source/groupBox.png" :
     {
     "prefix" : "../clipped/groupBox",
     "border-width" : 4
     }
     } 
     }
  },

  "image-combine" :
  {
     "extend" : ["common"],

     "combine-images" :
     {
     "images" :
     {
     "${RESPATH}/image-combined/combined.png":
     {
     "prefix" : [ "${RESPATH}" ],
     "layout" : "vertical",
     "input"  :
     [
      {
         "prefix" : [ "${RESPATH}" ],
         "files" : [ "${RESPATH}/image/clipped/groupBox*.png" ]
      }
     ]
     }
     }
     }
  }
 } 
}

这是我运行 image-clipping 和 image-combine 时发生的情况:

<块引用>

C:\custom>generate.py -c image.json 图像剪辑

初始化:自定义

配置:image.json

工作:图像剪辑

解析配置包括...

解决工作...

合并作业默认值...

正在解析宏...

正在解析库/清单...

执行:图像剪辑
<块引用> <块引用> <块引用>

正在初始化缓存...

完成

C:\custom>generate.py -c image.json 图像合并

初始化:自定义
<块引用> <块引用> <块引用>

配置:image.json

工作:图像组合

解析配置包括...

解决工作...

合并作业默认值...

正在解析宏...

正在解析库/清单...

执行:图像组合
<块引用> <块引用> <块引用>

正在初始化缓存...

组合图像...

  • 创建图像 C:\custom\source\resource\custom\image-combined\combined.png Magick:没有解码委托 图像格式 <代码>\docume~1\lomme\lokala~1\ tmpql73hk' @错误/constitute.c/ReadImage/532。 Magick:缺少图像文件名 C:\custom\source\resource\custom\image-combined\combined.png' @ 错误/montage.c/MontageImageCommand/1707。 montage 命令(montage -geometry +0+0 -重力西北 -tile 1x -背景 无 @c:\docume~1\lomme\lokala~1\temp\tmpql73hk C:\custom\source\resources\custom\image-combined\combined.png) 失败,返回代码如下:1

图像剪辑工作起来就像一个魅力,但当我尝试运行图像组合时,我收到一些错误消息。当我用谷歌搜索错误消息时,它说 ImageMagick 缺乏 PNG 支持,但我可以使用其他命令,如“转换 a.jpg b.png”,所以一定有某种 png 支持?

这是“identify -list format”返回的内容:

PNG* PNG rw- 便携式网络图形 (libpng 1.2.43)
                      详情请参阅 http://www.libpng.org/ 
                      关于 PNG 格式。

PNG24* PNG rw- 不透明 24 位 RGB (zlib 1.2.3)

PNG32* PNG rw- 不透明或透明 32 位 RGBA

PNG8* PNG rw- 8 位索引,带有可选二进制
                      透明度

那么为什么我会收到此错误消息: Magick:此图像格式没有解码委托

在我看来,有 png 支持吗?我以前从未使用过 ImageMagick,所以我完全迷失了:D

提前致谢

I want to create a button with rounded corners in Qooxdoo but I'm having some problems. I guess it's a problem with ImageMagick and not my Qooxdoo code, but I'll post it anyway.

So in order to create rounded corners I'm following this guide.

this is what my image.json contains:

{
 "jobs" :
 {
  "common" :
  {
   "let" :
   {
    "RESPATH" : "source/resource/custom"
   },

   "cache" :
   {
    "compile" : "../cache"
   }
  },

  "image-clipping" :
  {
     "extend" : ["common"],

     "slice-images" :
     {
     "images" :
     {
     "${RESPATH}/image/source/groupBox.png" :
     {
     "prefix" : "../clipped/groupBox",
     "border-width" : 4
     }
     } 
     }
  },

  "image-combine" :
  {
     "extend" : ["common"],

     "combine-images" :
     {
     "images" :
     {
     "${RESPATH}/image-combined/combined.png":
     {
     "prefix" : [ "${RESPATH}" ],
     "layout" : "vertical",
     "input"  :
     [
      {
         "prefix" : [ "${RESPATH}" ],
         "files" : [ "${RESPATH}/image/clipped/groupBox*.png" ]
      }
     ]
     }
     }
     }
  }
 } 
}

Here's what happens when I run image-clipping and image-combine:

C:\custom>generate.py -c image.json image-clipping

INITIALIZING: CUSTOM

Configuration: image.json

Jobs: image-clipping

Resolving config includes...

Resolving jobs...

Incorporating job defaults...

Resolving macros...

Resolving libs/manifests...

EXECUTING: IMAGE-CLIPPING

Initializing cache...

Done

C:\custom>generate.py -c image.json
image-combine

INITIALIZING: CUSTOM

Configuration: image.json

Jobs: image-combine

Resolving config includes...

Resolving jobs...

Incorporating job defaults...

Resolving macros...

Resolving libs/manifests...

EXECUTING: IMAGE-COMBINE

Initializing cache...

Combining images...

  • Creating image C:\custom\source\resource\custom\image-combined\combined.png
    Magick: no decode delegate for this
    image format
    \docume~1\lomme\lokala~1\ tmpql73hk'
    @ error/constitute.c/ReadImage/532.
    Magick: missing an image filename
    C:\custom\source\resource\custom\image-combined\combined.png' @
    error/montage.c/MontageImageCommand/1707.
    The montage command (montage -geometry
    +0+0 -gravity NorthWest -tile 1x -background None
    @c:\docume~1\lomme\lokala~1\temp\tmpql73hk
    C:\custom\source\resources\custom\image-combined\combined.png)
    failed with the following return code:1

The image-clipping works like a charm but I get some kinda error message when I try to run image-combine. When I google the error messages it says ImageMagick is lacking PNG support but I can use other commands like "convert a.jpg b.png" so there must be some kinda png support?

here's what "identify -list format" returns:

PNG* PNG rw-   Portable Network Graphics (libpng 1.2.43)
                      See http://www.libpng.org/ for details 
                      about the PNG format.

PNG24* PNG rw- opaque 24-bit RGB (zlib 1.2.3)

PNG32* PNG rw- opaque or transparent 32-bit RGBA

PNG8* PNG rw-   8-bit indexed with optional binary
                      transparency

So why do i get this error message:
Magick: no decode delegate for this image format

Looks to me like there's png support? I've never used ImageMagick before so I'm completely lost :D

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很酷不放纵 2024-09-13 02:44:18

您可能遇到了我认为较新 ImageMagic 版本中的错误。您既没有提供 qooxdoo 也没有提供 ImageMagic 版本,但这就是我从错误消息中猜测的。有一个与此相关的 qooxdoo 问题,其中包含修复以下问题的补丁问题。它已经在我们的开发版本中(trunk 和 1.1.x),但您可能不想升级到其中任何一个(如果您考虑到这一点,请选择 1.1.x)。另一种方法是在现有的 qooxdoo 安装之上应用补丁。这应该很容易,因为它是一个仅具有局部效果的单文件补丁。在 qooxdoo 的 tool/pylib/generator 路径下查找文件 ImageClipping.py

you've probably hit what I would consider a bug in newer ImageMagic versions. You neither gave your qooxdoo nor your ImageMagic version, but that's what I'm guessing from the error message. There is a qooxdoo issue relating to this, which contains a patch that fixes the problem. It is already in the our development versions (trunk and 1.1.x), but you might not want to upgrade to any of them (if you consider this, go for 1.1.x). The alternative would be applying the patch on top of your existing qooxdoo installation. This should be easy, as it is a single-file patch with only local effects. Look for the file ImageClipping.py under the tool/pylib/generator path in qooxdoo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文