首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FAL在Gifbuilder中的版权

FAL在Gifbuilder中的版权
EN

Stack Overflow用户
提问于 2016-11-02 21:14:22
回答 1查看 356关注 0票数 0

我想在用GifBuilder创建的图像上写一个版权条目:

代码语言:javascript
复制
lib.imageWithWatermark = IMG_RESOURCE
lib.imageWithWatermark {
  file = GIFBUILDER
  file {
    XY = [10.w],[10.h]
    format = jpg
    quality = 100
    10 = IMAGE
    10.file {
      import.data = current
      treatIdAsReference = 1
      maxW = 1600
      maxH = 1000
    }
    20 = IMAGE
    20.offset = [10.w]-[20.w]-20,[10.h]-[20.h]-20
    20.file = fileadmin/theme/lib/v1/img/watermark.png

    30 = TEXT
    30 {
      text = Copyright
      fontColor= #dddddd
      fontSize = 12
      offset = 20,[10.h]-20
      fontFile = fileadmin/theme/lib/v1/fonts/verdana.ttf
      align = left
      antiAlias = 1
    }
  }
}

在30文本,我需要从图像的元数据(流体中的image.resources.properties.creator),但我不知道如何做到这一点,在打字.

有什么帮助吗?谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-02 23:09:43

好吧,几个小时后我找到了解决办法。也许它对其他一些人有用. :-)

代码语言:javascript
复制
lib.imageWithWatermark = COA
lib.imageWithWatermark {

  # get meta data here - in GIFBUILDER it seems not possible
  10 = FILES
  10 {
    # current derives from a fluid template: it contains the uid of a sys_file_reference entry (!) - not sys_file
    # so we cannot use files but must use references which links sys_file_reference with sys_file. 
    references.data = current
    renderObj = COA
    renderObj {
      # we have to use register
      10 = LOAD_REGISTER
      10 {
        param = TEXT
        # Attention: current is now the current file in renderObj - it contains now the uid of the sys_file entry. 
        param.data = file:current:creator
      }
    }
  }

  # OK the more tradional rest
  20 = IMG_RESOURCE
  20 {
    file = GIFBUILDER
    file {
      XY = [10.w],[10.h]
      format = jpg
      quality = 100
      10 = IMAGE
      10.file {
        import.data = current
        treatIdAsReference = 1
        maxW = 1600
        maxH = 1000
      }
      20 = IMAGE
      20.offset = [10.w]-[20.w]-20,[10.h]-[20.h]-20
      20.file = fileadmin/theme/lib/v1/img/watermark.png

      30 = TEXT
      30 {
        # get text from register. 
        text.data = register:param
        fontColor= #dddddd
        fontSize = 12
        offset = 20,[10.h]-20
        fontFile = fileadmin/theme/lib/v1/fonts/verdana.ttf
        align = left
        antiAlias = 1
      }
    }
  }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40389900

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档