Typoscript IMAGE object: disable height/width attributes

jens_profile picture jens_profile · Jan 12, 2012 · Viewed 8.2k times · Source

Is there any way to prevent typo3/typoscript IMAGE object from adding the dimension attributes (height and width) to the generated image tag?

UPDATE (Thanks to cascaval)!

The solution is to use IMG_RESOURCE instead of IMAGE. It apparently has less bells an whistles but gives you complete control of the the generated image tag.

   10 = IMG_RESOURCE
   10.file.import = uploads/tx_templavoila/
   10.file.import.current = 1
   10.file.import.listNum = 0
   10.stdWrap.required = 1
   10.stdWrap.wrap (
      <img src="|" />
   )

Note: This is for use with Templavoila.

Answer

tmt picture tmt · Jan 12, 2012

No but you can use IMG_RESOURCE object instead and wrap the resulting image path so that you get a HTML tag you want. Example:

temp.image_test = IMG_RESOURCE
temp.image_test {
  stdWrap.wrap = <img src="|" />
  file = GIFBUILDER
  file {
    format = jpg
    quality = 90
    maxWidth = 9999
    maxHeight = 9999
    XY = [10.w],[10.h]

    10 = IMAGE
    10.file {
      import = uploads/pics/
      import.field = image
      import.listNum = 0
    }

    20 = SCALE
    20 {
      width = 200
    }
  }
}