From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,96b1bf0c24ced968 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.24.135 with SMTP id u7mr5142835wif.3.1346980967213; Thu, 06 Sep 2012 18:22:47 -0700 (PDT) Path: q11ni5513255wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!zen.net.uk!dedekind.zen.co.uk!reader02.nrc01.news.zen.net.uk.POSTED!not-for-mail Date: Fri, 31 Aug 2012 08:18:27 +0100 From: Mark Murray User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question: re Image Files. References: <7bd3df18-178b-4735-ac43-c6bb6df9e999@googlegroups.com> In-Reply-To: <7bd3df18-178b-4735-ac43-c6bb6df9e999@googlegroups.com> Message-ID: <50406532$0$10734$5b6aafb4@news.zen.co.uk> Organization: Zen Internet NNTP-Posting-Host: dd62faa0.news.zen.co.uk X-Trace: DXC=NI^KIH On 30/08/2012 23:33, Austin Obyrne wrote: > Question: Is there any way by which I can reading in from an image file and operate on the individual pixels in a similar arithmetical way. Yes, but you have to handle each individual image format (GIF, JPEG, BMP etc) separately. This is a LOT of work to write a general program. Either pick one type that you are going to use, or look at what you are really doing and see if ther is not a way to generalise. > If not how are image files handled in Ada is there any transformation process? Would I be correct in guessing that you are planning in reading these files with the intention of encrypting the contents? If so, then you can save yourself a MASSIVE amount of work by ignoring the structure of the files, and simply reading them byte-by-byte. That way you get a stream of numbers, all in the range 0-255, and as long as the decryption process returns the numbers to exactly what the original number was without missing or adding any, you can encrypt any file you like. There is demo code to do this here: http://people.freebsd.org/~markm/raw_io.adb (Disclaimer: I've not been using Ada for long; this program is likely not particularly idiomatic use of the language; suggestions for improvement gratefully accepted). M -- Mark "No Nickname" Murray Notable nebbish, extreme generalist.