DotDragnet
May 21, 2012, 04:50:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: follow us on twitter @dotdragnet
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: PHP image database questions  (Read 879 times)
JohneeMac
Guest
« on: October 26, 2007, 09:45:36 AM »

Im creating an php image database for users to choose images then send an php mail with the details of the photos they want ( no payment system).

I think i will set up a lightbox, as its a good way of viewing photos.

But: There are hundreds of photos, but if i use a batch process in PS and then upload them into a folder, can i make a php script the find the dimensions? It would save me a lot of time rather than manually putting in the width and height.

If the images are named say child1.jpg, child2.jpg, im guessing there is a simple way in php that i can extract the number (1,2) etc and put it beside each photo as a reference?

This may sound like a dodgy website here, but dont worry its for a small photography agency that are doing a photo shoot at a playgroup

As always thanks for your time.
Logged
Jeewhizz
DDN Contribs
Hero Member
*****
Posts: 1626



View Profile Awards
« Reply #1 on: October 26, 2007, 10:22:23 AM »

http://uk2.php.net/getimagesize

<?php
$file = 'child2.jpg';
preg_match("/(\d+)\.jpg$/i",$file,$match);
$digits = $match[1];
?>

$digits will have '2' for 'child2.jpg'. Or it'll be '123' for 'child123.jpg'

Jee
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!