tracker issue : CF-4205759

select a category, or use search below
(searches all categories and all time range)
Title:

Images don't appear in slides created by cfpresentation

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NeedMoreInfo

Reporter/Name(from Bugbase): David S. / ()

Created: 10/31/2019

Components: Document Management, Presentation

Versions: 2018

Failure Type: Non Functioning

Found In Build/Fixed In Build: 2018,0,05,315699 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description:
Images added to html for processing by CFPresentationslide do not appear in the finished file
Steps to Reproduce:
create *.png images from CFcharts (3 of them)
use cfsavecontent to put img tags, with src set  the absolute paths to image files, in variables.
under cfpresentationslide tag, use cfoutput to place the cfsavecontent variables (holding <img.. tags) in html table.
a <cfabort> placed before the closing cfpresentationslide tag will show that the images appear in the table.
cfpresentation tag creates the ppt file and saves it to a docs directory. 
Actual Result:
When downloaded, or copy and pasted out of the docs directory, the the images appear on the slide as 3 white squares with little red x's. (broken links)
Expected Result:
This works perfectly in coldfusion 2016. I expect to see the chart graphics embedded in the slide.
Any Workarounds:
Haven't found one yet.

Attachments:

Comments:

I was mistaken about the windows server being used, it is window server 2016.
Comment by David S.
31692 | October 31, 2019 07:58:22 PM GMT
I found a workaround for this from a blog post by Rupesh Kumar from 2005. this function he wrote is key: <cffunction name="localUrl" > <cfargument name="file" /> <cfset var fpath = ExpandPath(file)> <cfset var f=""> <cfset f = createObject("java", "java.io.File")> <cfset f.init(fpath)> <cfreturn f.toUrl().toString()> </cffunction> then I use localUrl() against the file path for the images, in the src attribute of the img tag. <cfset filepath = #localUrl("/brief/img/#varTimestamp##loopTotal#chart1.png")#> Anyway, this works perfectly.
Comment by David S.
31693 | November 01, 2019 05:16:05 PM GMT
<cfsavecontent variable="ppt_chart1"><img src="#filepath#" height="250" width="250"></cfsavecontent>
Comment by David S.
31694 | November 01, 2019 05:17:24 PM GMT
David, wouldn't it be easier if you just shared the relevant code snippets.... if for some reason you cant, please elaborated on the following: "create *.png images from CFcharts (3 of them) use cfsavecontent to put img tags, with src set the absolute paths to image files, in variables." specifically, how you are persisting the charts in file before apparently pointing to them in img tag.
Comment by Piyush K.
31888 | November 27, 2019 01:33:45 PM GMT
David, can you pls share the information requested in my last comment.
Comment by Piyush K.
33197 | February 26, 2020 11:55:06 AM GMT
Piyush K. : "specifically, how you are persisting the charts in file before apparently pointing to them in img tag." I think this code is what you are asking about? ... <cfoutput> <cffile action = "write" file = "#request.tempPath#/img/#varTimestamp##loopTotal#chart1.png" output = "#chart1#" > <cfset filepath = #localUrl("/brief/img/#varTimestamp##loopTotal#chart1.png")#> <cfsavecontent variable="ppt_chart1"><img src="#filepath#" height="250" width="250"></cfsavecontent> ...
Comment by David S.
33202 | February 26, 2020 01:51:21 PM GMT
David, you missed sharing that part that's generating the cfchart image, specifically the value for variable "cfchart1" in the little snippet you shared. Anyway the workaround looks ok, and the behavior without seems legitimate. For populating the src value for the img HTML tag you need to wrap the tag itself in cfoutput. It wouldn't work otherwise because it is not a CF tag. In case your local servlet is not blocked you could always embed the chart tag directly in the presentation tag rather than saving it a file, and them saving that using cfsavecontent. I'm closing this. But feel free to revert if you have any questions.
Comment by Piyush K.
33299 | March 16, 2020 02:13:49 PM GMT