![]() |
Watermarks again... I can't watermark my images... OK, I have spent the past 3-hours reading the posts here trying to figure my problem out with no luck... I had a watermark on my photoserver for a while but had to turn it off for bit because of a special project. Now, I am trying to trun back on the watermark and go back through the photos that were uploaded while the watermark was turned off and I can't. My server used GD2 and I have a watermark.png file. I have set the path to the PNG and when I upload new pics they get watermarked just fine. When I use the database utility [Scan Database >> Check Here to Watermark unwatermarked files] nothing changes. I went into the database as suggested in another thread and looked at the field with my photos. The cell for "watermarked is NULL for all of my photos :eek: I looked at the database structure and the default is supposed to be "no" 1. Can someone confirm if the 'no' becomes '' if the system thinks the image is watermarked? 2. Can someone confirm that if I change all the values to "no" that the watermark script is likely to work? 3. Anybody good with MySql that can give me a quick script to update all the photos? I am using the same watermark image so it will rewatermark over the existing image... I have a problem with images being used off my site all over the place and I want to at least get some return trafic for the bandwith I am paying to supply! Edit for Cliff Notes to Solution: The problem I had was caused by the server NOT having write permssion for the image file! The server would get a "No Permissions" message but the $watermarked variable was NEVER getting defined elsewhere so the value of the variable was NULL. When the database updated, the "no" became "null". With the value being NULL, the script would never try to watermark the images again (it wanted to see "no") and I would see the "done" message even though the images were not changed! More detail is in this thread! |
OK, I've been up all night so no sence in giving up yet... I wnt in my database and changed the "null" to "no" and I ran the ADMIN script to watermark images... That worked! After the watermark was added the "watermarked value" in the database became a "1" So, why does my upload have a NULL value for this? Where does this come from? I went in adm-misc.php and changed: Code: Content visible to verified customers only.Code: Content visible to verified customers only.This fixed my problem and now all my old images have the watermark.... Now, I am really curious what would cause the values in my database to have a NULL watrmarked value? |
Well, I still have no clue what is going on... Some of my images are now watermarked but the "watermarked: value is null for 928 rows, 1 row is ="1" and 1 row = "yes" in my pp_photos table It's 5AM so time to get a couple hrs of sleep before the wife gets up and expects me to do something other then fight with this script.... :eek: |
If you watermark a file the value is set to yes. I would suggest you do a query like this to grab any row thats not yes. You can confirm what I am saying by looking at your photo inserts that are watermarked it should be yes. This should get this straight. maybe an old upgrade issue not gone right. UPDATE pp_photos SET watermarked='no' WHERE watermarked !='yes' |
I think I have a file problem... My watermark tag in the database is NULL so that gives me the impression the variable is not getting defined somewhere in the script. I will debug this when I get a chance... Can someone confirm that the adm-misc.php file is the file that is most likely the concern? Next, I really need to put some smarts into the watermarking script so that if an image is small (say 100-250-px) that a smaller watermark is added to my images to prevent things like the following from happening: Code: Content visible to verified customers only.I will try to figure this out when I get a chance and most likely the place to start is with a fresh download and see from there.... EDIT TO ADD... I did the SQL command to change all the values to "No"... Then I reran the Admin tool to watermark and I did not reset my code to work with "No" ---> it still has the change above so it is looking for "Null" When I rant the script it did NOT watermark (as expected) BUT all the values changed from "NO" to NULL again inside my photos table! Very strange error as that data sould not be touched, right? I need more time to read all the code to figure it out... EDIT to Add #2 When I rerun the script a second time (with my change above) all the images seem to get watermarked and the "watermarked" value changes to "1" |
OK, this may help others that upgrade at some point... The reason my site was not watermarking all the images for me was that I had performed a full server backup before I had upgraded my forums. After the upgrade, I put the files back by FTPing them from my computer... Because I had done the backup to a DVD, all of my images has "READ" permissions. When I went in with my FTP client and update the permissions to WRITE for each image the script was again able to watermark all my images. I still have no idea why the script is replaceing the watermark value with "NULL" and I am not so sure about the advice above that the values once watermarked should say "yes" as even after this fix the watermark value in my database = "1" But, my images are all watermarked and all those websites using my bandwith are at least now advertising for my site and that is what this was all about! |
I think maybe in the past you missed an upgrade The watermarked field is a varchar field with a default vaue of no not null. $query[] = "ALTER TABLE photos ADD watermarked varchar(5) NOT NULL default 'no';"; this was all the way back in 3.06 upgrade |
Thanks, and I thought I had posted this above... (maybe in my own notes on my server) but the default is "no" (ETA - Yup in post 5 above)! The problem is that these values are changed to "null" when the admin script to add thumbnails is run! Right now my photoserver is working, and all my images have watermarks... I think there is a code error in there however and if I get the time I will find it for you! I also really do want to recode the watermark script to add a SMALL watermark to small images as I have a few members that have small pics that look like this now: Code: Content visible to verified customers only. |
Line 1611 of adm-misc.php should read this in bold Code: Content visible to verified customers only. |
Quote:
Mine says: Code: Content visible to verified customers only.Edit to add: I just went into the member area and downloaded the script again. The newest version of PhotopostPro is 5.31 and when I open the Admin-Misc.php file is has the same code as what I have on my uploaded version.... I'll let you figure that one out.... |
As said the code SHOULD BE ;) Just replace the line with what I posted |
OK, it looks like I have this all figured out... I have added my "Cliff Notes" of what I learned at the bottom of the first post but reposted here: Quote:
I have two product enhancement suggestions that would have prevented this problem as well... 1. Perhaps you should create a check in there to verify that the server has write permission for an image and let the user know if not 2. Create a default "no" value for the variable so it only gets changed from no if the image is actually watermarked. Finally, I will take my search for a way to have a smaller watermark for smaller images to a new thread as I have pretty much got my problem figured out with this issue... |
| All times are GMT -5. The time now is 04:46 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0