ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 28th, 2004, 05:21 AM
prs_kishore prs_kishore is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 23 prs_kishore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 5 sec
Reputation Power: 0
get binary file data into an integer array

hai everybody,

For manipulating an image, I need to get the image data
into an integer array initially.

I was not able to convert the "variable" data into integer type, which("variable") is automatically produced after execution of the tag

<cffile action = "readbinary"
variable = "output"
file = "c:\images\nikon.jpg">

I think All the data is being lost, after converting to "base64"
or "string" type.

So, anyone please give me some code to get the image data
into an integer array.

Thanking you in advance,
kishore

Reply With Quote
  #2  
Old December 28th, 2004, 08:34 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
This is going to be the same issue as your other question. CFFILE is not meant to read in binary data byte by byte, nor is it meant to create arrays of bytes. The easiest way to do this is with Java (or wiritng a C++ custom tag but that is more work in my opinion).

Calling Java classes inside CFML is very easy, you use createObject() to create an instance of a Java class, and then you can call methods on it just like you would on a CFC instance. This applies to classes you write as well as the existing Java API classes.

The docs have some info:
http://livedocs.macromedia.com/cold...mldocs/java.htm

But Googling it may give some more detailed or applicable examples:
http://cephas.net/blog/2003/06/28/c...coldfusion.html
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old December 28th, 2004, 02:45 PM
glively glively is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 17 glively User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 51 sec
Reputation Power: 0
According to the CF documentation, it shoudl work. Here's a clip from the CFMX 6.1 docs:

Reads a binary file (such as an executable or image file) on the server, into a binary object parameter that you can use in the page. To send it through a web protocol (such as HTTP or SMTP) or store it in a database, first convert it to Base64 using the ToBase64 function.

Note: This action reads the file into a variable in the local Variables scope. It is not intended for use with large files, such as logs, because they can bring down the server.

** Notice that the docs say "To send it through a web protocol (such as HTTP or SMTP) or store it in a database, first convert it to Base64 using the ToBase64 function."

Reply With Quote
  #4  
Old December 29th, 2004, 04:40 AM
prs_kishore prs_kishore is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 23 prs_kishore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 5 sec
Reputation Power: 0
hai kiteless,
You are really doing a great job.First i should thank you, for your keen interest
in answering to members questions.

Ya ! What you said is right.
I will try to build my application using java API classes.

I am already having the complete code for my application in c++, but i cannot create a
cfx tag because of some installation problems with coldfusion,as i pointed earlier in my other query.

Any way, thanks a lot for your help.
I will read the docs for java.

thank you,
bye
kishore.

Reply With Quote
  #5  
Old December 29th, 2004, 04:50 AM
prs_kishore prs_kishore is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 23 prs_kishore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 5 m 5 sec
Reputation Power: 0
hai glively,
ya ! I have read the cf docs about reading binary image data.They pointed to convert the binary data into into base64(we use ToBase64(string)).

I think, it is a very complex and error-prone task in cfml because images(jpeg,tiff,,etc)
contain many complex characters(many special characters), which will be lost after
converting to base64(i have done it).

The only way, as far as i know, is to directly read the image character by character into integer type, and try manipulating them.

Any way, as Mr.Kiteless has pointed out, i will try using java classes.

Thank you,
bye
kishore.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > get binary file data into an integer array


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT