Background colors for individual photos Background colors for individual photos
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Background colors for individual photos

Started by Jet_Jaguar, December 20, 2003, 01:48:35 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Jet_Jaguar

I've been looking at other's galleries, and I've noticed that often the color of the background clashes with the actual photos.  Some pictures would look better with a black or a white border, and this varies from shot to shot.

I think it would be cool if each photo could have a preferred background color.  This could be a field in the database containing the RGB codes, just as there are fields for the captions. It wouldn't have to be something definite in HTML like a table cell or a image border;  In fact, it would be preferable if it was a common php variable that style authors could access.
Admin of the Guytalk.org forums - Guys talking about guy stuff.

rbl

IMHO, this is a feature that few users would want and only half of them would really use. Adding to that, is the huge amount of work needed to make it work properly and not suck ass (have you imagine a page with several table cells each one with a different color?)

I sometimes feel the need for a feature like that and the best I could came up with, after thinking about it for sometime, was something like this:
 - Create a set of css styles that would fit most situations and give them names, example: .5w2b = 5px white padding around picture and 2px solid black border; .4b1c = 4px black padding around picture and 1px solid #cccccc border; etc.
 - Be sure to choose a naming convention that would fit all your needs without exceptions, I mean, all class names have only 4 alpha-numerical characters like the example above
 - Name all your files prior to upload with the appropriate class code separated with a special character (that always must be the same), something like: 5w2b_portrait-of-dorian-grey.jpg, 4b1c_blueflower.jpg
 - Add some regular expressions code in CPG to look for those 4 alpha-numerical characters in the name, extract them and add them to the img tag as a class, example <img src="/albums/10001/4b1c_blueflower.jpeg" class="4b1c" .. />

Jet_Jaguar

First, it wouldn't in the actual galleries, but rather in the intermediate pages (IOW, the displayimage.php pages.)  Sorry I didn't make that clear.

Second, I don't see why all that was necessary (a byzantine numbering scheme and regular expressions?)  

It could be done simply in two ways:

1) have the user type in a BGColor value for each picture, record that value as a database entry (7 char value), assign that value to a variable, and in the page, have the table cell's background color be whatever is in the variable ( like <td bgcolor="<?php echo $bgcolor ?>" >)

-or-

2) Have the user select a color from a drop-down list, record that selection in the database, use that value as a css class (like <td class="<?php echo $bgcolor ?>" >
Admin of the Guytalk.org forums - Guys talking about guy stuff.

rbl

Quote from: "Jet_Jaguar"First, it wouldn't in the actual galleries, but rather in the intermediate pages (IOW, the displayimage.php pages.)  Sorry I didn't make that clear.

Second, I don't see why all that was necessary (a byzantine numbering scheme and regular expressions?)

Using it in the displayimage.php would be a lot different and less prone to chromatic mayhem =)

I made that suggestion because it would not alter the current database scheme. Any of the solutions you provided are, of course, much simpler in conception and use than any bizantine numbering systems =)
Question is: changes to the database are rarely made and (from small bits here and there, I believe) the dev team are continuing one of Greg's quests: lighten database calls and load.