Gifbuilder 的版权来自 FAL

Copyright in Gifbuilder from FAL

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

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.text 我需要来自图像元数据的条目(image.resources.properties.creator 在流体中)但我不知道如何在打字中实现这一点......

有什么帮助吗? 谢谢!

好的,几个小时后我找到了解决方案。也许它对其他人有用...... :-)

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
      }
    }
  }
}