It is currently Wed 1 Apr 2020 12:35 GMT
Change font size

    Latest Message from British Expat:

  • UK clocks go forward at the weekend!
    Britain's (and most of Europe's) clocks go forward an hour at 0100 GMT (0200 British Summer Time) on Sunday 29 March.

Photographers and Artists

Chuffed with Meself!

Looks like we have a few photographers and artists in our midst so here's a place to talk about all photography, art, and related subjects.

Chuffed with Meself!

Postby Savannah_Alan » Thu 14 Sep 2006 15:08 GMT

It's not often I get very excited about programming/scripting these days, but last night I knocked up an elegant solution that I'm really quite pleased with.

I have an area on my web site where I display my ongoing "study" of the area I moved to this year. It was a static web page before and I had to resize the photos, create copyright text on them all, create thumbnails and write the HTML every time I added a photo.
This was all getting to be a bit much - especially if I wanted to rearrange the order of the photos.

So, here's what I came up with (boring technical details warning):
I created a bash shell script (sort of MS-DOS on steroids) that calls the ImageMagick libraries. This takes all the images I have placed in a certain directory and resizes them, adds a photo frame, applies a certain amount of sharpening, adds a copyright notice and saves them elsewhere at 85% quality. It then creates a 200px thumbnail of the same image and saves it to a "thumbs" directory.
That's all the photos prepared with one command :D .

Now, to display: I have created a simple text file in the web directory, each line of which contains simply the name of the file, the "|" symbol and a caption.
I then have just two php pages. The first one reads the text file, parses the filename and the caption and dynamically creates the "thumbnail" page placing all the thumbnails in rows and columns in the order they appear in the text file and adds the caption.
Clicking on the thumbnail takes you to the second php page, which displays the larger size picture with filename and caption that has been sent in the request variable from the first page. Clicking on the photo on the second page takes you back to the first!

Sorry about all the boring technical details, but the upshot is that I now just have to place the photos in a particular directory, type "./process.sh" and voila! it's all done! If I want to change the order they are displayed in, or change the caption, I simply edit the text file.

Anyhoo, here are the results:
http://www.savannahsoftware.com/PhotoGallery

Alan.

P.S. Any regulars on here that would like the code, I would be glad to share.
Don't forget, there's much going on at the main site: http://www.britishexpat.com
The Safe Scooter Riding blog. www.ScootSafely.com
Posted by:
User avatar
Savannah_Alan
Supporter
 
Posts: 1824
Joined: Thu 23 Jan 2003 00:46 GMT
Location: Dahlonega, Georgia, USA - Originally from Southend-On-Sea, Essex.

Postby Graeme » Thu 14 Sep 2006 19:34 GMT

Hi Alan, I haven't a clue what you're talking about but the pictures are very nice :)

Graeme
Hungry for magazines from Britain? Visit the main web site at http://www.britishexpat.com and satisfy that craving!
Posted by:
User avatar
Graeme
Site Admin
 
Posts: 2129
Joined: Wed 1 Oct 2003 02:14 GMT
Location: British Columbia, Canada.

Postby Kay » Thu 14 Sep 2006 19:48 GMT

Wow!

I kinda ran away when I saw the techie stuff, but Graeme's comment encouraged me to go and look.

They're very, very, good.
Not Delia - Foodie blog with lots of reviews and recipes.
Posted by:
User avatar
Kay
Site Admin
 
Posts: 15338
Joined: Wed 22 Jan 2003 13:06 GMT
Location: Kent for a couple of years

Postby Savannah_Alan » Thu 14 Sep 2006 19:51 GMT

I haven't a clue what you're talking about but the pictures are very nice.

:crackup: Somehow, I expected that answer :lol: . Ignore me, I'm just rambling with the tech stuff. It's just rare and nice to come up with an elegant solution that saves a lot of time and does a useful job of work.

Glad you like the photos.

Alan.
Last edited by Savannah_Alan on Thu 14 Sep 2006 20:17 GMT, edited 1 time in total.
Don't forget, there's much going on at the main site: http://www.britishexpat.com
The Safe Scooter Riding blog. www.ScootSafely.com
Posted by:
User avatar
Savannah_Alan
Supporter
 
Posts: 1824
Joined: Thu 23 Jan 2003 00:46 GMT
Location: Dahlonega, Georgia, USA - Originally from Southend-On-Sea, Essex.

Postby Savannah_Alan » Thu 14 Sep 2006 19:58 GMT

Thanks Kay,
Those are a subset of the shots I've taken so far this year.

What's even better is that we've got the Autumn colours coming soon, when the leaves turn beautiful vivid colours. I've yet to see it, but I've heard about it for years and it should be good. I hope I don't wear my camera out by then :wink: .

Ooh, then I'm hoping for some snow in the winter - more photo ops there. Do you get the idea I like this area? :wink:

Who knows. Maybe in time, I'll publish a book of Dahlonega scenery for the local arts and crafts stores.

Alan.
Don't forget, there's much going on at the main site: http://www.britishexpat.com
The Safe Scooter Riding blog. www.ScootSafely.com
Posted by:
User avatar
Savannah_Alan
Supporter
 
Posts: 1824
Joined: Thu 23 Jan 2003 00:46 GMT
Location: Dahlonega, Georgia, USA - Originally from Southend-On-Sea, Essex.

Postby Trev » Thu 14 Sep 2006 20:53 GMT

Great photographs Alan.

On the full size image page there appears to be an image that does not load, however, if I click on it it returns me to the tn page.

Screen capture below
Image
Trev & Vania - Varna - Bulgaria

http://www.tcinbg.net
Posted by:
User avatar
Trev
Supporter
 
Posts: 1370
Joined: Fri 9 Jul 2004 09:52 GMT
Location: Varna, Bulgaria

Postby Savannah_Alan » Thu 14 Sep 2006 20:58 GMT

Thanks Trev.

You obviously caught it while I was messing with it (that'll teach me to work on the live server :lol: ).
That bug was only there for a matter of a minute or so. You just had good timing! It should be gone now.

Alan.
Don't forget, there's much going on at the main site: http://www.britishexpat.com
The Safe Scooter Riding blog. www.ScootSafely.com
Posted by:
User avatar
Savannah_Alan
Supporter
 
Posts: 1824
Joined: Thu 23 Jan 2003 00:46 GMT
Location: Dahlonega, Georgia, USA - Originally from Southend-On-Sea, Essex.

Postby Trev » Thu 14 Sep 2006 21:20 GMT

:lol: :lol:
Trev & Vania - Varna - Bulgaria

http://www.tcinbg.net
Posted by:
User avatar
Trev
Supporter
 
Posts: 1370
Joined: Fri 9 Jul 2004 09:52 GMT
Location: Varna, Bulgaria

Postby Dave » Fri 15 Sep 2006 02:28 GMT

Lovely photos, Alan!

I'd be very interested to see how you did it, too. Doesn't it feel great when you can design something to do in seconds what used to take you minutes or even hours? :compucoffee:
British Newspapers Online - your handy guide to the UK's national, regional and local press!
ErgoGuides - Great travel and business eBooks from British Expat!
Posted by:
User avatar
Dave
Site Admin
 
Posts: 7267
Joined: Tue 21 Jan 2003 15:04 GMT
Location: Currently UK

Postby Savannah_Alan » Fri 15 Sep 2006 02:50 GMT

Thanks Dave.
Yes, it's very satisfying - especially when the solution is very small and elegant.

The whole thing is 3 small files (well, 4 if you count the text file). I've e-mailed you them. Give me a holler if you have any questions about it. Of course, this is a Linux only solution right now, but the ImageMagick libraries are available for Windows, I believe, and it wouldn't take long to re-write the small bash script to a DOS batch file.

Alan.
Don't forget, there's much going on at the main site: http://www.britishexpat.com
The Safe Scooter Riding blog. www.ScootSafely.com
Posted by:
User avatar
Savannah_Alan
Supporter
 
Posts: 1824
Joined: Thu 23 Jan 2003 00:46 GMT
Location: Dahlonega, Georgia, USA - Originally from Southend-On-Sea, Essex.

Postby Dave » Fri 15 Sep 2006 03:15 GMT

Thanks, Alan - very neat indeed. I'm impressed!
British Newspapers Online - your handy guide to the UK's national, regional and local press!
ErgoGuides - Great travel and business eBooks from British Expat!
Posted by:
User avatar
Dave
Site Admin
 
Posts: 7267
Joined: Tue 21 Jan 2003 15:04 GMT
Location: Currently UK

Postby ruggie » Fri 15 Sep 2006 12:32 GMT

Very slick. When the size of the site I'm working on grows to php proportions, I hope to be contacting you. Not sure that I want to get involved in writing scripts and creating/maintaining databases.

Oh, and nice pics, too - but I've come to expect that. :)
Whether you live in France, or just find the country interesting http://www.franceforfreebooters.com/201 ... nts-up-50/
Posted by:
ruggie
Supporter
 
Posts: 3196
Joined: Sun 28 Nov 2004 09:09 GMT
Location: France

Postby Savannah_Alan » Fri 15 Sep 2006 15:01 GMT

Thanks Mike. :D .

Alan.
Don't forget, there's much going on at the main site: http://www.britishexpat.com
The Safe Scooter Riding blog. www.ScootSafely.com
Posted by:
User avatar
Savannah_Alan
Supporter
 
Posts: 1824
Joined: Thu 23 Jan 2003 00:46 GMT
Location: Dahlonega, Georgia, USA - Originally from Southend-On-Sea, Essex.

Postby SSue » Tue 19 Sep 2006 10:45 GMT

Give yourself another pat on the back Alan - they're all great photos
Sydney Sue - Don't cry because it's over, smile because it happened.
Read all about it! http://www.britishexpat.com/563.0.html
Posted by:
SSue
Supporter
 
Posts: 4465
Joined: Fri 31 Oct 2003 23:21 GMT
Location: From Grimsby, Lincolnshire, to Sydney, then Port Macquarie NSW Australia


Return to Photographers and Artists



cron