I have the following function that produces the image width and height. The function 
works perfectly when the FileLoc argument has a  directory value from my local server, 
but I get the following error:

 Can't read input file!  
     
        
      The error occurred in 
D:\Inetpub\wwwroot\sitename\FunctionPages\admin\ProductManager.cfc: line 711
     
709 :          
710 :           <cfset ImageInfo = StructNew()>
711 :           <cfset ImageObject = 
createObject("java","javax.imageio.ImageIO").read(jFileIn)>
712 :     
713 : 


 when I try to read an image from another server with the FileLoc argument having the 
following value http://www.sitename.com/images/imagename.jpg.


<cffunction name="ProductImageSize" returnType="struct" access="public">
    
     <cfargument name="FileLoc" type="string" required="Yes"> 
        
  <cfset jFileIn = createObject("java","java.io.File").init(ARGUMENTS.FileLoc)>
         
     <cfset ImageInfo = StructNew()>
     <cfset ImageObject = createObject("java","javax.imageio.ImageIO").read(jFileIn)>
    
     <cfset ImageInfo.ImgWidth = ImageObject.getWidth()>
     <cfset ImageInfo.ImgHeight = ImageObject.getHeight()>
    
    <cfreturn ImageInfo>

  </cffunction>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=36

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182308
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to