Skip to main content
Known Participant
October 5, 2011
Question

cfimage and .tif

  • October 5, 2011
  • 2 replies
  • 1635 views

I'm reading a scanned TIF images from a network drive, converting it to png then manipulating  it adding a "watermark" then pushing it to the browser. For some images, it works but for others, I get an I/O error.

An exception occurred while trying to read the image.

I/O error reading image metadata!


Here  is my code


  <cfimage action="read" name="invoiceImg" source="#img#" >

          <cfimage action="convert" destination="e:\inetpub\wwwroot\CFShared\CFTemp\epay-pel/img.png" source="#invoiceImg#" overwrite="true" >

          <cfimage action="read" name="invoiceImg" source="e:\inetpub\wwwroot\CFShared\CFTemp\epay-pel/img.png" >

          <cfset ImageResize(invoiceImg,"850","","blackman",2)>

          <cfset attr=StructNew()>

          <cfset attr.size = 58>

          <cfset attr.style = "bolditalic">

          <cfset attr.font = 'Arial Bold' />

          <cfset ImageSetDrawingColor(invoiceImg,"red")>

          <cfset ImageSetDrawingTransparency(invoiceImg,40)>

          <cfset ImageDrawText(invoiceImg, "GR Not Completed",175,200,attr)>

          <cfset ImageDrawText(invoiceImg, "ff-GR Not Completed",145,250,attr)>

          <cfset ImageAddBorder(invoiceImg,2,"black")>

          <cfimage action="writeToBrowser" source="#invoiceImg#" format="jpg">

          <cffile action="delete" file="#expandpath('/lib_temp')#\epay-pel/img.png">

Any Help would be great.

Product Version 9,0,1,274733 Enterprise.


    This topic has been closed for replies.

    2 replies

    LukeDDAuthor
    Known Participant
    October 5, 2011

    An exception occurred while trying to read the image.

    I/O error reading image metadata!
    The error occurred in E:/inetpub/wwwroot/cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/view/public/dsp_client_elec_manager.cfm: line 188
    Called from E:/inetpub/wwwroot/CFShared/CFTemp/epay-pel/parsed/do.v_public.client_elec_manager.cfm: line 9
    Called from E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/fuseboxExecutionContext.cfc: line 46
    Called from E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/fuseboxApplication.cfc: line 624
    Called from E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/myFusebox.cfc: line 318
    Called from E:/inetpub/wwwroot/cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/model/public/act_client_elec.cfm: line 10
    Called from E:/inetpub/wwwroot/CFShared/CFTemp/epay-pel/parsed/c_public.client_elec.cfm: line 61
    Called from E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/Application.cfc: line 232
    Called from E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/Application.cfc: line 220
    Called from E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/fusebox5.cfm: line 57
    Called from E:/inetpub/wwwroot/cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/index.cfm: line 35
    186 :           <cfdump var="#img#"> 187 :      <cfdump var="#IsImageFile(img)#"> 188 :      <cfimage action="info" name="invoiceImg" source="#img#" structname="st" isbase64="false"> 189 :      <cfdump var="#st#"> 190 :      <cfimage action="convert" destination="e:\inetpub\wwwroot\CFShared\CFTemp\epay-pel/img.png" source="#invoiceImg#" overwrite="true" > 

    Resources:

    Browser  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.6 (KHTML, like Gecko) Chrome/16.0.899.0 Safari/535.6
    Remote Address  132.156.31.85
    Referrer  http://dev1-cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/index.cfm?action=c_public.client_elec_terms&s34=581&dadae026816e5fa4d153c15f2191a
    Date/Time  05-Oct-11 02:46 PM
    Stack Trace
    at cfdsp_client_elec_manager2ecfm2027928051.runPage(E:/inetpub/wwwroot/cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/view/public/dsp_client_elec_manager.cfm:188) at cfdo2ev_public2eclient_elec_manager2ecfm44235985.runPage(E:/inetpub/wwwroot/CFShared/CFTemp/epay-pel/parsed/do.v_public.client_elec_manager.cfm:9) at cffuseboxExecutionContext2ecfc180684195$func__EXECUTEDYNAMICDO.runFunction(E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/fuseboxExecutionContext.cfc:46) at cffuseboxApplication2ecfc363897832$funcDO.runFunction(E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/fuseboxApplication.cfc:624) at cfmyFusebox2ecfc1054716737$funcDO.runFunction(E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/myFusebox.cfc:318) at cfact_client_elec2ecfm102897985.runPage(E:/inetpub/wwwroot/cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/model/public/act_client_elec.cfm:10) at cfc_public2eclient_elec2ecfm1224764039.runPage(E:/inetpub/wwwroot/CFShared/CFTemp/epay-pel/parsed/c_public.client_elec.cfm:61) at cfApplication2ecfc735759280$funcONREQUEST._factor2(E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/Application.cfc:232) at cfApplication2ecfc735759280$funcONREQUEST.runFunction(E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/Application.cfc:220) at cffusebox52ecfm865498566.runPage(E:/inetpub/wwwroot/CFShared/Frameworks/fusebox5/fusebox5.cfm:57) at cfindex2ecfm404476662.runPage(E:/inetpub/wwwroot/cfusion3.nrcan.gc.ca/auth/epay-pel.nrcan-rcan.gc.ca/application/index.cfm:35)

    coldfusion.image.ImageReader$ImageReadingException: An exception occurred while trying to read the image. at coldfusion.image.ImageReader.readImage(ImageReader.java:110) at coldfusion.image.Image.<init>(Image.java:250) at coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:431) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfdsp_client_elec_manager2ecfm2027928051.runPage(E:\inetpub\wwwroot\cfusion3.nrcan.gc.ca\auth\epay-pel.nrcan-rcan.gc.ca\application\view\public\dsp_client_elec_manager.cfm:188) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfdo2ev_public2eclient_elec_manager2ecfm44235985.runPage(E:\inetpub\wwwroot\CFShared\CFTemp\epay-pel\parsed\do.v_public.client_elec_manager.cfm:9) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cffuseboxExecutionContext2ecfc180684195$func__EXECUTEDYNAMICDO.runFunction(E:\inetpub\wwwroot\CFShared\Frameworks\fusebox5\fuseboxExecutionContext.cfc:46) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:382) at cffuseboxApplication2ecfc363897832$funcDO.runFunction(E:\inetpub\wwwroot\CFShared\Frameworks\fusebox5\fuseboxApplication.cfc:624) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cfmyFusebox2ecfc1054716737$funcDO.runFunction(E:\inetpub\wwwroot\CFShared\Frameworks\fusebox5\myFusebox.cfc:318) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cfact_client_elec2ecfm102897985.runPage(E:\inetpub\wwwroot\cfusion3.nrcan.gc.ca\auth\epay-pel.nrcan-rcan.gc.ca\application\model\public\act_client_elec.cfm:10) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfc_public2eclient_elec2ecfm1224764039.runPage(E:\inetpub\wwwroot\CFShared\CFTemp\epay-pel\parsed\c_public.client_elec.cfm:61) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfApplication2ecfc735759280$funcONREQUEST._factor2(E:\inetpub\wwwroot\CFShared\Frameworks\fusebox5\Application.cfc:232) at cfApplication2ecfc735759280$funcONREQUEST.runFunction(E:\inetpub\wwwroot\CFShared\Frameworks\fusebox5\Application.cfc:220) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cffusebox52ecfm865498566.runPage(E:\inetpub\wwwroot\CFShared\Frameworks\fusebox5\fusebox5.cfm:57) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfindex2ecfm404476662.runPage(E:\inetpub\wwwroot\cfusion3.nrcan.gc.ca\auth\epay-pel.nrcan-rcan.gc.ca\application\index.cfm:35) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:360) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    Inspiring
    October 5, 2011

    Hard to say with so little to go on. You need to post some code, the full error message, and if at all possible a sample of a failing .tif file.

    LukeDDAuthor
    Known Participant
    October 5, 2011

    Just did. for some reason code didn't appear when put in using the insert HTML function.

    Inspiring
    October 5, 2011

    Ah yes, these lovely forums ...

    Which line is throwing the error the first cfimage read? Also any chance of attaching a sample image?

     

    -Leigh