May 22, 2003

I turned my attention to image insertion and editing the attributes of an already entered image yesterday. I was trying to find out how to retrieve the attributes for an inserted image but was not getting anywhere and so I decided to stop and concentrate on a different problem – being able to use all formats of web-ready images. I’d been working so far only with BMP files and when I tried to insert a JPG or a GIF file, I discovered that they would not display properly. So I had to sit down and discover how to get JPG and GIF files to show up on the WPTools components and after some unnecessary code edits (which I had to revert), I finally figured out how to do it after taking a look at one of the WPTools demos. Of course, at that point I did not think of including PNG images (I remembered this only later in the evening) but it should be a simple matter to do the necessary changes now.

Once I had the images displaying properly, I went back to work on retrieving the image attributes but try as I might, I couldn’t seem to get this to work right. I finally decided to write to the WPTools usenet group for help but almost as soon as I’d done that, I figured out where I was going wrong :p I had had tunnel vision in that I’d been looking only at a particular property to find the image file location whereas the location was stored in a completely different property! So lesson learned – just because there is a property named FileName does not mean that the FileName will be stored there :p Anyway, once I got over that particular bit, the rest was pretty easy and I had the image attribute editing working by the time I concluded work for the day.

Now all that remains is for me to go back and modify the publishing and parsing routines so that the parsing routine looks for image and file links and converts them from local hard disk references to remote server references at the time of publishing. I also am considering adding a published flag to each entry so that I can automatically upload linked files to the server but under the current setup that would not work too well since the published property would be set for the very first publish and if you publish the same journal to multiple server, the files will not be uploaded to the rest of the servers. Granted that this might be a problem for only a few people, but it still would be a problem. So that will probably have to wait till I do the database restructuring …

Be Sociable, Share!
Tags: General
Posted by Fahim at 6:29 am   Comments (0)