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=-1.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2, FREEMAIL_FROM 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.224.39.75 with SMTP id f11mr3146337qae.8.1346403484937; Fri, 31 Aug 2012 01:58:04 -0700 (PDT) Received: by 10.52.67.12 with SMTP id j12mr1333544vdt.7.1346403484917; Fri, 31 Aug 2012 01:58:04 -0700 (PDT) Path: da15ni860qab.0!nntp.google.com!r1no10502qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 31 Aug 2012 01:58:04 -0700 (PDT) In-Reply-To: <50406532$0$10734$5b6aafb4@news.zen.co.uk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.149.3.155; posting-account=pmkN8QoAAAAtIhXRUfydb0SCISnwaeyg NNTP-Posting-Host: 109.149.3.155 References: <7bd3df18-178b-4735-ac43-c6bb6df9e999@googlegroups.com> <50406532$0$10734$5b6aafb4@news.zen.co.uk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Question: re Image Files. From: Austin Obyrne Injection-Date: Fri, 31 Aug 2012 08:58:04 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-08-31T01:58:04-07:00 List-Id: On Friday, August 31, 2012 8:18:11 AM UTC+1, Mark Murray wrote: > 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 pi= xels in a similar arithmetical way. Yes, but you have to handle each indivi= dual 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, o= r look at what you are really doing and see if ther is not a way to general= ise. > If not how are image files handled in Ada is there any transformatio= n 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 retu= rns 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 thi= s here: http://people.freebsd.org/~markm/raw_io.adb (Disclaimer: I've not b= een using Ada for long; this program is likely not particularly idiomatic u= se of the language; suggestions for improvement gratefully accepted). M -- = Mark "No Nickname" Murray Notable nebbish, extreme generalist.