Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typoscript IMAGE object: disable height/width attributes

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.

like image 327
jens_profile Avatar asked Sep 23 '26 07:09

jens_profile


1 Answers

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
    }
  }
}
like image 52
tmt Avatar answered Sep 25 '26 20:09

tmt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!