RE: [PHP] building web album - design questions

2003-01-10 Thread Daevid Vincent
Why re-invent the wheel. There are plenty of these out there...

Two I suggest are

[1] mine... http://daevid.com/photo_album.phtml

And

[2] http://www.andymack.com/freescripts/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] building web album - design questions

2003-01-09 Thread bbonkosk
 Hi,
 
   I'm planning to build a web album for my digital photographs, and have 
 some questions regarding the design:
 
   1) Is it better to store the images within the database, or just store 
 pointers to the images which is put outside, in the filesystem?
 
IMHO, store a link of pointer to the images

   2) At log in, I want to show to which albums new pictures have been added 
 since last visit. For performance reasons, should information about last 
 added pictures be added to the database, or is it ok to make a MySQL-query 
 each time, comparing the add-date for every picture in every album with the 
 users last log in date?
 

How often will this get hit?  If often you could also update a string in a test 
file the same time you do your database/album updates.  But a huge traffic is 
not a cause for concern you should be able to safely execute a query every time 
to find out the lastest pictures/albums updated.

   3) If I've understood things right, there is functions within PHP that 
 can handle picture resizing? Is that correct?
 

Yes, some good tutorials out there.  I don't know about internal PHP functions, 
I often just call ImageMagik from inside my php script to re-size my images, 
but I'm sure there are plenty of ways...

HTH
-brad
   Best regards,
 
Anders Thoresson
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] building web album - design questions

2003-01-09 Thread Rick Emery
1.  Store images separately with pointers in the database.  It permits faster database 
queries.

2.

3.  int imagecopyresized ( resource dst_im, resource src_im, int dstX, int dstY, int 
srcX, int srcY,
int dstW, int dstH, int srcW, int srcH)

- Original Message -
From: Anders Thoresson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 2:20 PM
Subject: [PHP] building web album - design questions


Hi,

  I'm planning to build a web album for my digital photographs, and have
some questions regarding the design:

  1) Is it better to store the images within the database, or just store
pointers to the images which is put outside, in the filesystem?

  2) At log in, I want to show to which albums new pictures have been added
since last visit. For performance reasons, should information about last
added pictures be added to the database, or is it ok to make a MySQL-query
each time, comparing the add-date for every picture in every album with the
users last log in date?

  3) If I've understood things right, there is functions within PHP that
can handle picture resizing? Is that correct?

  Best regards,

   Anders Thoresson


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] building web album - design questions

2003-01-09 Thread Kevin Stone

- Original Message -
From: Anders Thoresson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 09, 2003 1:20 PM
Subject: [PHP] building web album - design questions


 Hi,

   I'm planning to build a web album for my digital photographs, and have
 some questions regarding the design:

   1) Is it better to store the images within the database, or just store
 pointers to the images which is put outside, in the filesystem?

Unless the images are small and easily managed I would recommend to store
the images in the filesystem.  You'll find this method is faster and more
versitile.  A simple script can be written to reconsile the database with
the filesystem should you need to tamper with it.

   2) At log in, I want to show to which albums new pictures have been
added
 since last visit. For performance reasons, should information about last
 added pictures be added to the database, or is it ok to make a MySQL-query
 each time, comparing the add-date for every picture in every album with
the
 users last log in date?

I don't foresee any bottlenecks here.  Just store the timestamp of the last
login and the timestamp of each upload.  If you're clever you can perform
the comparison with one db query.  Define the timestamp as the index for the
album table and I guarentee speed will not be an issue even with a heavy
traffic load and tens of thousands of entries.

   3) If I've understood things right, there is functions within PHP that
 can handle picture resizing? Is that correct?

http://www.php.net/manual/en/ref.image.php
Or if you need to get more sophisticated such as adding water-marks and
stuff I recommend you install (or have your ISP install) imagemagick.

Sounds like a fun project.  Good luck!

-Kevin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] building web album - design questions

2003-01-09 Thread Chris Wesley
On Thu, 9 Jan 2003, Anders Thoresson wrote:

   I'm planning to build a web album for my digital photographs, and have
 some questions regarding the design:

I don't want to discourage you from hacking your own code ... that's phat,
so plz take this just as some heads-up info:

IMHO, Gallery can't be beat for a web photo album.  It's got some of its
own problems and lacking features, but it's a solid idea with a lot of
code for doing, well, just about everything you'd want to do with a web
photo album.  I didn't write it nor know the people who do.  However, I do
use it, and have hacked at it for my own albums:

http://gallery.menalto.com/index.php

If for no other use, it's probably a valuable project to study.  Check it
out, and dive into its code for features you like.  You may find ways to
implement some things well, and, like I, find ways to NOT implement things
poorly.  (BTW, it doesn't use a database for anything!)

That said 

   1) Is it better to store the images within the database, or just store
 pointers to the images which is put outside, in the filesystem?

Keep files in the filesystem :)

   2) At log in, I want to show to which albums new pictures have been added
 since last visit. For performance reasons, should information about last
 added pictures be added to the database, or is it ok to make a MySQL-query
 each time, comparing the add-date for every picture in every album with the
 users last log in date?

Personal photo albums tend to be low-traffic.  And you're aiming for a
very specific functionality ... a repeating query is probably a safe
solution (seems like the only one, too).

   3) If I've understood things right, there is functions within PHP that
 can handle picture resizing? Is that correct?

Yes.  http://www.php.net/manual/en/ref.image.php

g.luck,
~Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php