phppup Posted January 25, 2020 Share Posted January 25, 2020 It's always these seemingly simple tasks that become challenges. I got a good handle on how to watermark some photos (thanks to respondents to my previous post) and developed a script that calls a function that uses imagettftext() Essentially, I can upload multiple images and watermark them before they reach their destination folder. Good stuff. Now, I got this crazy idea of watermarking them with a sequence number, so that if I grab 12 images, each will be labeled with it's sequence number (rather than a standard text watermark). I placed $count++ in my script, and then used $count as my $watermark both inside imagettftext and as a variable. It didn't work. The closest I got was after placing $count++ inside a watermark function, but. of course, that merely labeled each photo with a "1" (bc each call of the function was a new iteration. Can someone please offer some direction here. Thanks. Quote Link to comment Share on other sites More sharing options...
requinix Posted January 25, 2020 Share Posted January 25, 2020 If you have problem getting your code to work then a good first step would be to post said code. Quote Link to comment Share on other sites More sharing options...
phppup Posted January 25, 2020 Author Share Posted January 25, 2020 Yes, yes, the code. But first, I'd like to try to resolve this with some education. (especial since I've managed to get the basics of the code working). And I'm wondering if I may be creating my web of complications unnecessarily. So here's a question (that may unravel some mystery and resolve my issues): are there a set of BEST PRACTICES for handling images? After I have uploaded several images, I want to resize and watermark them. At first, my thought process was to create separate functions and call them accordingly upload(); resize (); watermark (); Then I wondered whether I was creating unnecessary redundancy and server load. Am I grabbing the image and writing it to my /images_folder and then grabbing it again to resize and overwrite it, then re-grabbing it and watermarking it and re-overwriting it again? Is that creating workload? Is it better to nest the watermarking function within the resizing for a more streamlined flow? Or does that create impracticalities of it's own? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted January 26, 2020 Share Posted January 26, 2020 I would upload the images and resize them to a separate folder and use THOSE for my web page. Perhaps a click response on a reduced one could take the user to the full size one on a separate page? This eliminates the need to repeatedly re-size images for every user. Quote Link to comment Share on other sites More sharing options...
Barand Posted January 26, 2020 Share Posted January 26, 2020 7 hours ago, phppup said: Is it better to nest the watermarking function within the resizing for a more streamlined flow? Or does that create impracticalities of it's own? It all depends on your requirements. Do you ever have a requirement for a reduced-size version that does not have a watermark? Do you want to store the original full-size image with or without the watermark? Note that as soon as you manipulate the uploaded image you lose any exif data (such as rotation). Do you require different sizes of images (thumbnail for product listings and medium when viewing individual product, say)? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.