CFIMAGE WriteToBrowser Not Working


#1

New to Lucee and ran into an odd issue. I am using CFIMAGE with the WriteToBrowser action.

<cfimage source="d:\somepath\someimage.png" name="myImage" action="writetobrowser" height="52" />

Verified the file is there, but no output to the browser, nor does it throw an error. Am I missing something?

Thanks in advance.

Alberto


#2

Hi @alberto,

From your code just remove the name attribute then you’ll see your image on the browser.

As per docs, Name attribute is required for action=“read”. If you dump the name attribute from your code you can see the details of your image that will hold by the name.


#3

Is this an incompatibility with ACF?


#4

Yeah! ACF works fine.


#5

Silently failing isn’t great…


#6

Hi @cfmitrah,

Thanks that worked! Unfortunately, the height parameter in the tag is not being respected. This is the output.

<img src="/lucee/graph.cfm?img=163C25D7-D89B-4932-8B92EBDB9BC21C93.png&amp;type=png" width="512" height="354">

In any case, I will keep playing with it.

Alberto


#7

Quick update… I tried adding the width parameter as well but that did not help. I also tried the passthrough parameter, which did work. Then, I decided it was better to not resize inline. Instead, I just wrote a script to resize the images en masse. This way I take the need of the inline resize out of play, which leans out the request from a disk IO and processor perspective.

Thanks again!