Re: [Zope] blob image from MySql
On Tue, 1 Mar 2005 21:40:28 +0100, Adriano <adriano@euma.com> wrote:
Well, there's no longer the "array(c,...) starting; But it still doesn't work correctly
To be more specific, the downloaded file now starts like:
(Your original start looks like this in quoted-printable encoding: ?=9D??=00=10JFIF=00=01=01=01=00H=00H=00=00??=00C=00=06=04=04=04=05=04=06=05= =05=06 Note the JFIF, which is a tagging standard for JPEG). Are you quite sure the data in the database isn't corrupted to start with? It's not entirely clear to me (after reviewing this thread) how you got it in there in the first place. After looking at some JPEGs with hexdump, it appears that most of them (those using the JFIF standard) start with the hexadecimal sequence d8ff e0ff. I have some which use the EXIF standard instead and these start d8ff e1ff. In any event, they should all start with 0xd8ff; that seems to be the magic number. For example, one of them starts like this: ff d8 ff e0 00 10 4a 46 49 46 00 01 02 01 01 2c |......JFIF.....,| It looks like you might be missing 4 bytes of data at the beginning, or else your pasted stuff got mangled. -- Computer interfaces should never be made of meat. Using GMail? Setting Reply-to address to <> disables this annoying feature. You are in a maze of twisty little passages all alike. To go north, press 2. To go west, press 4. To go east, press 6. To go south, press 8. If you need assistance, press 0 and a little dwarf will assist you.
Andy,
On Tue, 1 Mar 2005 21:40:28 +0100, Adriano <adriano@euma.com> wrote:
Well, there's no longer the "array(c,...) starting; But it still doesn't work correctly
To be more specific, the downloaded file now starts like:
(Your original start looks like this in quoted-printable encoding:
?=9D??=00=10JFIF=00=01=01=01=00H=00H=00=00??=00C=00=06=04=04=04=05=04=06=05= =05=06
Note the JFIF, which is a tagging standard for JPEG).
Are you quite sure the data in the database isn't corrupted to start with? It's not entirely clear to me (after reviewing this thread) how you got it in there in the first place.
well, a little company I know has a java app, you can watch it at www.arteikon.it and then click on the store ("Visita il negozio !") This java app has a relational db made in MySql. This db contains also the pictures of the store. I'm exploring the possibility to port that app on Zope in order to have something a bit more manageable than the Java stuff Of course, the pictures that are in the db have to be leveraged ! So I need to show those pics from within Zope ! But now that you make me think about it, I'm going to try to upload a pic in the db myself from inside Zope and then try to watch it. Possibly the java machinery makes something to the bits... Your quote of my original start is not what I thouth I pasted. I also checked the sent message and the chars are not the same. I don't know wether this is a joke of the e-mail protocols. Some of the chars I sent are grey squares, on my screen. Instead your ones are readable numbers and letters. Well... Andy you've been kind enough. I just hoped someone here had similar experience and could suggest me something. Now I try with some other pics in the db (I'm tryin every time with the same pic) and then I'll try to upload a pic myself... I'll let you know How difficult would be to connect to relationa data from Zope 3 ? Bye Catonano P.S. Andy, did I thank you for your kindness ? ;)
After looking at some JPEGs with hexdump, it appears that most of them (those using the JFIF standard) start with the hexadecimal sequence d8ff e0ff. I have some which use the EXIF standard instead and these start d8ff e1ff. In any event, they should all start with 0xd8ff; that seems to be the magic number.
For example, one of them starts like this:
ff d8 ff e0 00 10 4a 46 49 46 00 01 02 01 01 2c |......JFIF.....,|
It looks like you might be missing 4 bytes of data at the beginning, or else your pasted stuff got mangled. --
-- " One of the tricks here is to get away from thinking that programs have to be composed with only a simple text editor " - Alan Kay - "Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS". - Alan Kay - "The computer revolution hasn't started yet. Don't be misled by the enormous flow of money into bad defacto standards for unsophisticated buyers using poor adaptations of incomplete ideas". -Alan Kay -
Hi. I am able to capture the content from a page template in a Script Python like this: template_html = context.some_folder.folder_contents() But I have a page template that I am wanting to capture output from that requires parameters passed - normally like this after the template name ?id=test_id Can someone suggest the correct syntax for doing this as in the example above. I am wanting to use a Script Python as opposed to wget or urllib Regards, David
David Pratt wrote:
Hi. I am able to capture the content from a page template in a Script Python like this:
template_html = context.some_folder.folder_contents()
But I have a page template that I am wanting to capture output from that requires parameters passed - normally like this after the template name ?id=test_id
Too keep this working identically, you would do: context.REQUEST.set('id','test_id') template_html = context.some_folder.folder_contents() or, you could do: template_html = context.some_folder.folder_contents(id='test_id') ...if you change occurances such as request/id to request/id|options/id cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (4)
-
Adriano -
Andy Dustman -
Chris Withers -
David Pratt