来自FAL的Gifbuilder版权所有

时间:2016-11-02 21:14:23

标签: typo3 typoscript

我想在使用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)输入,但我没有任何线索如何在typoscript中实现这一点......

有任何帮助吗? 谢谢!

1 个答案:

答案 0 :(得分:1)

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

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
      }
    }
  }
}
相关问题