Module: Emboss module

mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Fri, 2012-02-17 15:15

Emboss module

An alternative watermarking module
- Allows adding an overlay to ALL image sizes, not just resize and thumbnails.
- Allows use of different overlays based on (full) image size.

If you would like to see a site using this module, feel free to visit my Digital Arts gallery

I have only tested on one platform (GoDaddy linux server) using one browser (Chrome for OSX).
If you encounter any problems on other platforms, please let me know.

Mike

AttachmentSize
emboss.zip25.27 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-02-17 18:34

Thanks for your contribution and codex page: http://codex.gallery2.org/Gallery3:Modules:emboss as well.
I don't use watermarks but I am sure that the community will like the features!

Cheers!
Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2012-02-17 23:27

This member of the community sure likes the features!! Thanks. I use watermarks just like this [wait for boo's]. To get this effect, what I had to do is upload pre-watermarked copies created using a Photoshop script. However this makes the process of changing the watermark a tedious one, because as my Gallery grows and grows a complete upload gets larger and larger. What this module allows me to do is change the watermark without the re-upload hassle.

I see you created a copy of the unwatermarked image. I gather that it really wasn't possible to do watermarking on-the-fly? I guess there would be a performance hit.

U-G

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Sat, 2012-02-18 03:59

I played around with "watermarking on the fly" I was never terribly impressed with the result.

I think if I had gone straight to imagemagick without going through the generalized graphics helper code, I may have been able to pull it off. But I didn't want to alienate users that do not have imagemagick on their system.

Also, I did, after all, develop this first and foremost for my own use. I liked the watermarks I could generate in GIMP much better than those that I could generate with imagemagick.

If you have some thoughts, I might play around with adding that ability as well (either in this or another module.)

Thanks for the feedback!

mike

 
markusk

Joined: 2006-04-20
Posts: 60
Posted: Sun, 2012-03-25 17:19

built-in watermarking module never worked for me as it didn't find GD or IM (both present on my server) - so i thought i'd give this a try..

downloaded, unzipped, visited modules-page to activate.. hit "update", heading to configure - but no "emboss" in "content" menu.. switch to modules again - uh - not enabled.. once more.. nothing. at some point i happen to pass by on the dashboard and see the log at the bottom showing that i'm said to be copying items to the /originals folder.. but hey.. my stuff all *is* in the originals folder?!.. but still it seems to copy everything, taking a while of course with a rather big database - might be worth mentioning on the codex page..

so after a while i now got a bunch of error-messages "Failed to create folderXY" (not sure yet why) and a "Activated: Emboss" at the top of the dashboard. well actually i got five "Activated module emboss" in the log ;)

ok then. but now? upload an overlay. ok.

"best fit method" .. mh.. "See Overlays above for more information on how each possible value affects overlay selection" i don't get this sentence :( ..

and what happens if i hit update now? does it watermark *all* my originals/resizes/thumbs? from the codex-page i can't see how this really can be controlled.. i.e. how could i prevent it from watermarking my full sized originals - i only want thumbs and resizes to be.. wich actually led me here - the closure of this bug: http://sourceforge.net/apps/trac/gallery/ticket/1746#comment:1 (which implies such "selective watermarking" would be possible)

and thinking/reading further - if a single change of settings triggers *all* my ~20k of images and versions to be re-embossed, this might take a while..

thanks anyways, will keep an eye on this ;)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-03-25 00:04

HTML5 canvas allows for watermarking on the fly.
example(sorry about the terms example too)

Also here where I overlay a play button.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-03-26 00:15
 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Mon, 2012-03-26 01:39
Quote:
so after a while i now got a bunch of error-messages "Failed to create folderXY" (not sure yet why) and a "Activated: Emboss" at the top of the dashboard. well actually i got five "Activated module emboss" in the log ;)

Unfortunately, I only have on platform on which to develop/debug this module. I have created a debug version of the emboss module which will dump a lot of extra information that we can use to get to the bottom of the "Failed to create folder..." issue.

Please let me know if you want to pursue additional debugging or not. I'm willing to put in the time if you ware willing to go through the couple iterations it may take to work out the problem.

Quote:
"best fit method" .. mh.. "See Overlays above for more information on how each possible value affects overlay selection" i don't get this sentence

The best fit method refers to the algorithm used to select which overlay to apply to any given image. If you don't understand the options, I recommend going with either the "Maximize Area" or "Minimize Borders" method.

Quote:
and what happens if i hit update now? does it watermark *all* my originals/resizes/thumbs?

It updates all the images (all three variants) that need to be updated to reflect your changes. The first time you configure the module, this translates to all images that are no smaller than your smallest overlay. Future changes may only require updating a subset of your images; e.g. if your current largest overlay is 640x480 and you add a new 1600x1200 overlay, any image larger than 640x480 will need to be updated, but those smaller than 640x480 will not.

Quote:
how could i prevent it from watermarking my full sized originals - i only want thumbs and resizes to be

Sorry, that was the whole impetus for this module. I found the built-in watermark module lacking in that it does not update the full size images. The design of the emboss module is centered around the concept of adding an overlay/watermark to every level.

mike

 
markusk

Joined: 2006-04-20
Posts: 60
Posted: Tue, 2012-03-27 00:19
Quote:
Please let me know if you want to pursue additional debugging or not. I'm willing to put in the time if you ware willing to go through the couple iterations it may take to work out the problem.

for sure i would, but i would have to do it again on my live (and rather big) database. the question actually is if it's good (or reasonable) design to copy files to a location where they actually are yet ;) btw. - if files in /originals stay untouched - where would the embossed full size files reside then?

Quote:
Sorry, that was the whole impetus for this module. I found the built-in watermark module lacking in that it does not update the full size images. The design of the emboss module is centered around the concept of adding an overlay/watermark to every level.

understood - but don't you think there could be an (easy) way to actually give control over which sizes are embossed? of course one could use a blank transparent png, but that might give a lot of useless duplicate data and processing time..

markus.

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Tue, 2012-03-27 03:28
Quote:
the question actually is if it's good (or reasonable) design to copy files to a location where they actually are yet ;) btw. - if files in /originals stay untouched - where would the embossed full size files reside then?

I may be misinterpreting your comment, but it appears you might not understand the underlying Gallery 3 architecture. The full size images are stored in the directory gallery/var/albums (in a hierarchy that perfectly mirrors how your albums are nested). I am creating a new folder (gallery/var/originals) that mirrors the gallery/var/albums structure. I am not copying the files on top of themselves.

Gallery 3 knows nothing about this new gallery/var/originals directory, only the emboss modules knows about it. The embossed full size images are created by applying the appropriate overlay to the images in the originals directory and saving the result in the albums directory. As far as Gallery is concerned, the embossed image is the full size image.

If the unembossed images were not copied, there would be no way to change/remove the overlays at a future time as there would no longer be a pristine original available. The reason emboss does this right off the bat is to greatly reduce the risk of inadvertently irreversibly altering an image should things get out of sync. (The originals are never modified by emboss). Note that this is exactly the reason that the built-in watermark modules does not modify the full size image.

As far as the question of whether or not this is good design, I will only point out, that I must work within the confines of the Gallery 3 framework and that I [IMNSHO] believe that this is a rather solid solution to the constraints under which I had to work.

Quote:
...but don't you think there could be an (easy) way to actually give control over which sizes are embossed?

I'm sure there would be a way to give the user control over which sizes are embossed.... but it would not be an "easy" solution. The emboss module modifies only the full size image (in the albums directory). It then marks the thumbs and resizes as dirty and sets up a task for Gallery to regenerate these sizes. To do what you're suggesting would require either selectively marking the other sizes as dirty or to re-implement much of the code in core Gallery 3 with some minor tweaks. Either way, if any other module (or theme) marked the thumb or resize as dirty, the embossed imaged would at that point be sized down to the other sizes and bring the overlay with it. I'm sure that "surprise" would raise more eyebrows than the points you raise.

I do appreciate your feedback, but at the end of the day, I wrote this module for my use and chose to share it with anyone who finds it useful. I am willing to clear up platform specific issues and incorporate easy enhancements that I think might make the module more appealing. But, I make no promises about making core design changes that I may never find a personal use for.

mike

 
markusk

Joined: 2006-04-20
Posts: 60
Posted: Sat, 2012-03-31 21:29
mikemayer67 wrote:
Quote:
the question actually is if it's good (or reasonable) design to copy files to a location where they actually are yet ;) btw. - if files in /originals stay untouched - where would the embossed full size files reside then?

I may be misinterpreting your comment, but it appears you might not understand the underlying Gallery 3 architecture.

my fault indeed. there has been a /var/originals in that gallery of mine before installing your module, i have no idea where it came from (must have been another module i had installed at some earlier point) - i assumed all the originals were in there, neglecting the /albums. sorry, didn't work with g3 outside of it's web-interface for a while.

Quote:
The emboss module modifies only the full size image (in the albums directory). It then marks the thumbs and resizes as dirty and sets up a task for Gallery to regenerate these sizes.

so it's not the emboss module which does the watermarking of the thumbs and resizes then?

another question arising now - if i disable/remove the emboss-module, is everything set to it's initial state? /originals copied back to /albums and /originals deleted? or would one have to do this by hand?

thanks,
markus.

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Wed, 2012-08-22 23:25

Watermark is not working w/ .png files, so I thought I would try this and this does not work at all :(

When I check the emboss box in Modules and click update 'nothing' happens. No page refresh, nada....

Please advise.
Thank You, Sincerely,
bburnett

Platform information:

Host name: box443.bluehost.com
Operating system: Linux 2.6.32-20120131.55.1.bh6.x86_64
Apache: Unknown
PHP: 5.2.17
MySQL: 5.1.63-community-log
Server load: 49.27 45.41 39.67
Graphics toolkit: gd

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Thu, 2012-08-23 02:30

emboss module covered all my album covers, and basically everything in my Gallery so I can't view any pics.
40+ hours of work down the toilet!!! :(

My question:

"How do I UN-emboss my images?"

bburnett

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Thu, 2012-08-23 21:10
mikemayer67 wrote:

I do appreciate your feedback, but at the end of the day, I wrote this module for my use and chose to share it with anyone who finds it useful. I am willing to clear up platform specific issues and incorporate easy enhancements that I think might make the module more appealing. But, I make no promises about making core design changes that I may never find a personal use for.

mike

maybe you should have kept this module to yourself and NOT shared it, because it caused me A LOT of work to fix my Gallery. Your Emboss Module screwed up mySQL database and I had to have my hosting company roll my site back to a week earlier.
Thanks for the extra work and migraine headache!

bburnett
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Fri, 2012-08-24 03:12

I am sorry to hear about your difficulties with emboss. I have been using it for over a year now with absolutely no problems. I wish you had allowed me to get back to you to help you recover what you believe you lost before redoing all of your work. I took a lot of steps to ensure that everything could be rolled back easily.

Without getting more information than, "it's broken and it sucks," it's really hard for me to help you out.

Just curious. Did you try unselecting all of your install overlays? (Admin>Content>Emboss). Doing so should have restored all of your artwork. The ONLY database tables that emboss touches are ones it creates. It does not modify any of the gallery databases that are not created by emboss. A total rollback was probably not necessary.

Again, I'm sorry that you were not able to take advantage of this module.
I will add some info on the gallery wiki page for emboss giving information how to safely back out the embossing.

mike

If you wish to see a website that is using it without problem, see http://www.vmwishes.com/gallery.

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Fri, 2012-08-24 03:20

Yes I tried un-selecting my 1 installed overlay and it didn't work. My hosting company said there was file that the emboss module created (or had left behind) that prevented the SQL database restoring from an earlier date.

It's over. No big deal. Humpty Dumpty has been put back together.

Peace,
bburnett

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Fri, 2012-08-24 03:57

You might want to add somewhere in the documentation:

If you are on a shared server and/or have over 2000+ pictures this might not be the solution for you, because it almost doubles the size of the footprint on the server, and slows things way, way down.

bburnett

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Fri, 2012-08-24 04:03

The documentation states that the module makes a copy of all of the original work. This should imply that it will double your memory footprint.

My site has about 300 images on it and takes about 5 minutes to emboss all of them. I would think that 2000 images would take 7 times as long (35-40 minutes).
The reembosing occurs on the server and is handled via maintenance tasks so that your site can still be accessed as it processes all of the images (unless you take it
into maintenance mode). But yes, a comment would be in order in the documentation so that people know what to expect.

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Sat, 2012-08-25 04:16

my old G2 install had 4000+ pics so I imagine anywhere from 1 to 2 hours for that embossing. Yes I knew it double my footprint, but the average user will not be aware of how much it bogs down a shared server.

Peace,
bburnett

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
Evilchen

Joined: 2007-02-27
Posts: 6
Posted: Thu, 2012-09-06 11:23

Hi Mike,
i use your Module for 2 Gallerys since you posted it. Got no Problems with it within now.
But i have an other Request to you,
is it possible, that the Module emposses new Photos direct after they are uploaded? i often post new Pictures from my Mobile (xotof as Client) and cant start the embossing dialog direct after it.

isnt there a way to start it automaticaly?

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Fri, 2012-09-07 03:27

The original implementation (prior to initial release) was that way. It was a real pain in that the lag between posting and getting a response back from my gallery site was excessive... or I may have just been too impatient.

It would not be terribly hard to add a checkbox to allow the user to do an immediate update rather than creating a maintenance task. I would NOT want to make this the only (or even the default) behavior. But I could live with it as a user controlled option.

I'll give it some thought.

 
Evilchen

Joined: 2007-02-27
Posts: 6
Posted: Fri, 2012-09-07 05:51

that would be wonderfull. if there will be something laggy wenn setting it to default, then it probably would be better to give it as setting, but not activating it by default.

Another Way i could imagine, would be a cronjob. In the configs serve a Link by witch i could start the embossing.

Both, the Autoemboss and the cronjob would be heaven ;)

 
tekeler

Joined: 2012-10-22
Posts: 6
Posted: Fri, 2012-10-26 07:02

absolutely one of if not the best module i have installed on my site.
Thanks so much for this Mike! was looking for a good tool to use for protecting my photo communities images and help to increase site traffic!

People shouldn't be complaining since they were the ones who decided to install it. And regarding this comment

bburnett wrote:

maybe you should have kept this module to yourself and NOT shared it, because it caused me A LOT of work to fix my Gallery. Your Emboss Module screwed up mySQL database and I had to have my hosting company roll my site back to a week earlier.
Thanks for the extra work and migraine headache!

bburnett
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

i saw you said that you knew that it would double your footprint. but the average user wouldn't understand? This must imply that you are an expert webmaster. Which is something i would disagree with as someone as smart as yourself should know that the number one rule before modifying anything on your website is to make a backup of EVERYTHING especially when you have as much stuff as you say you do.

So before you go trying to trash someone else's work because of a problem you encountered likely due to user error because others here seem to be having no problems. Try covering your own back side :p

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Fri, 2012-10-26 16:02

Thanks for the positive feedback. I was truly thinking about scrapping the whole thing as it seemed to be bringing more grief than it was worth. (I would have kept my own copy, as I personally am happy with it).

I am currently in the process of revamping it based on a few truly useful suggestions that I have received AND to add some more error checking to help reduce the potential for messing up people's databases/albums. Big goal is to make sure that current databases will roll gracefully into new version.

mike

 
tekeler

Joined: 2012-10-22
Posts: 6
Posted: Fri, 2012-10-26 21:42

sounds great mike. I look forward to seeing something roll out. As for now i think what you've done here is great. Keep up the good work!

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Sat, 2012-10-27 01:45

Are you really serious? Try using this module with 4000+ pics and see what happens.

You MUST have too much free time on your hands.

Your second post on this board!

Pathetic, just pathetic!

BB

tekeler wrote:
absolutely one of if not the best module i have installed on my site.
Thanks so much for this Mike! was looking for a good tool to use for protecting my photo communities images and help to increase site traffic!

People shouldn't be complaining since they were the ones who decided to install it. And regarding this comment

bburnett wrote:

maybe you should have kept this module to yourself and NOT shared it, because it caused me A LOT of work to fix my Gallery. Your Emboss Module screwed up mySQL database and I had to have my hosting company roll my site back to a week earlier.
Thanks for the extra work and migraine headache!

bburnett
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

i saw you said that you knew that it would double your footprint. but the average user wouldn't understand? This must imply that you are an expert webmaster. Which is something i would disagree with as someone as smart as yourself should know that the number one rule before modifying anything on your website is to make a backup of EVERYTHING especially when you have as much stuff as you say you do.

So before you go trying to trash someone else's work because of a problem you encountered likely due to user error because others here seem to be having no problems. Try covering your own back side :p

"sometimes the world is cruel to shiny things" - Elroy "Lucky" Kleinschmidt

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2012-10-27 03:21
floridave has in the past, wrote:
It is posts like that that make me think twice about continuing to be a member of the community.

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Sun, 2012-10-28 02:07
bburnett wrote:
Are you really serious? Try using this module with 4000+ pics and see what happens.

You MUST have too much free time on your hands.

Your second post on this board!

Pathetic, just pathetic!

BB

Might I suggest not using my module if you don't like it....

Might I also suggest you consider how much you paid for this module....

Might I also suggest... (no, I won't go there).

The great thing about projects like Gallery3 is that it is free. The price you pay is that you don't get to gripe and throw stones when it doesn't work exactly like you would like. There are clearly people who do benefit from this module (myself included).

And, no, I do not have too much time on my hands. With work, church, scouts, PTA, ballet, yard work, home maintenance, etc... I average about 4-5 hours of sleep per night. I do this to pay forward all of the free stuff I have gotten from collaborative communities such as this.

Again, I expect you will never use my module again... And that's perfectly ok by me. Now please, kindly shut up and go away.

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Sun, 2012-10-28 02:15

Ironically, One of the things I would like to address in my upcoming second release of the emboss module is how to gracefully handle adding overlays to all of the images on a large site. (And yes, this is in response to "Mr." Burnett's complaint. Despite his boorishness, he does raise a point that may be impacting others aw well.) If anyone (beside him) with a large collection of images is interested in running a beta test on your site, I would greatly appreciate this. I will walk you through how to make sure your site is adequately backed up in order to do a painless restore should something go wrong.

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Sun, 2012-10-28 02:40
suprsidr wrote:
HTML5 canvas allows for watermarking on the fly.
example(sorry about the terms example too)
...
-s

A while back (March, I believe), you commented that watermarking can be accomplished directly in HTML5 and pointed me to a site in which you did this. I took a careful look at what you posted. Is that a Gallery3 site??? When I looked at the underlying HTML, it looks very different from what I see when I look at my and other's Gallery3 sites.

It appears that you have a layer of redirection that keeps me from getting to the URL of the underlying raw image (xxx.jpg.html). This is not the case (to the best of my understanding) in the Gallery3 framework. The whole idea of the watermark (as I'm sure you are aware) is to protect ownership of the original artwork. If I the watermark is only added in the rendered web page and the URL of the original artwork can be discovered, it would appear your technique would fail to provide this protection.

Again, it appears that on your site the URL to the original is sufficiently hidden. If you can tell me how to do this in the Gallery3 framework as well, then your approach has some clear advantage over mine.

Thanks,
mike

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Sun, 2012-10-28 21:29

Trying to remain positive here. Tier 3 engineering at BlueHost informed me that your emboss module has some coding in it that automatically overwrites the SQL database that it lives on, thus preventing users from restoring their SQL databases from back up.

bburnett

"Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe."
Frank Zappa

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-10-28 21:13

@bburnett
I have a working example of watermarking on the fly and w/out a net panel you cannot see any image sources.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Sun, 2012-10-28 23:44
bburnett wrote:
Trying to remain positive here. Tier 3 engineering at BlueHost informed me that your emboss module has some coding in it that automatically overwrites the SQL database that it lives on, thus preventing users from restoring their SQL databases from back up.

If your Tier 3 experts are telling you the truth*, then you have bigger issues. It is true that emboss adds two tables to the Gallery 3 mySQL databases on your server and that it routinely updates the content of these two tables.

BUT... it does so using exactly the same mechanisms that gallery itself uses! If my module has the ability to corrupt your database, then so does Gallery itself..

Moreover, if adding tables and/or data to a database corrupts it so that it cannot be restored from backup (or more unlikely that it prevents other databases from being restored), then there exists a problem, not with my module, but with your host's database architecture.

mike

*Having dealt with multiple helpdesks over the years (including those within the company for which I work), I have observed that more often then not, their first response is to try to pass the buck off as someone else's problem. They won't actually look at their side of the world until you have exhausted every scenario they can concoct that points to someone other than themselves.

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Mon, 2012-10-29 00:13
suprsidr wrote:
@bburnett
I have a working example of watermarking on the fly and w/out a net panel you cannot see any image sources.
-s

First off... LOVE the photography on your site.

Second... I must confess that I'm still missing something here. Is there a module creating the watermarking in the example you provided above? Or is there some other mechanism adding the watermarking? If it's the former, what is its name and where is it available. I would like to check it out a little further (and possibly abandon emboss in favor of it.)

Thanks,
mike

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-10-29 01:16

I made a few small changes to my theme.

  • album.html.php - replace the thumb in the foreach loop w/
    <canvas id="<?= $child->id ?>" rel="thumb" width="<?= $child->thumb_width ?>" height="<?= $child->thumb_height ?>"></canvas>
  • photo.html.php - similarly replaced the resize w/
    <canvas id="<?= $item->id ?>" rel="resize" width="<?= $item->resize_width ?>" height="<?= $item->resize_height ?>"></canvas>
  • page.html.php - added some js just before </body> to draw the thumb/resize along w/ my watermark to the <canvas />

I retrieved the image's info via an ajax call to the REST interface so the image info is never displayed in the source.

Benefits:

  • Puts all the work on the client
  • Hides source info
  • User cannot simply disable javascript as they will see nothing
  • Right-click -> copy still gets the watermarked image
  • It was kinda fun ;)

I wasted a few minutes coding to draw the full image/watermark to an offscreen <canvas /> in order to generate watermarked image data for the full view... but I doubt you'd be wanting to allow full view anyways.

<canvas /> is fun, allowing for may effects like grayscale onmouse over.

All in all this was a ~20 minute hack(mostly thinking how-to)

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Mon, 2012-10-29 04:00

If you can add a "progress bar" to your module (don't know how difficult that would be), but it would at least give folks an idea that it is in fact working/embossing images. Happy Halloween :)

Sincerely,
bb

"Some scientists claim that hydrogen, because it is so plentiful, is the basic building block of the universe. I dispute that. I say there is more stupidity than hydrogen, and that is the basic building block of the universe."
Frank Zappa

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-10-29 05:57
mikemayer67 wrote:
First off... LOVE the photography on your site.

Interfacelift.com
I'm a developer, not a photographer.
I have at least 2 dozen sites w/ the same images displayed in many ways.
Image/video/audio presentation is my specialty.

but thanks

there is nothing I cannot make gallery do.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
mikemayer67
mikemayer67's picture

Joined: 2012-01-10
Posts: 42
Posted: Mon, 2012-10-29 20:28
suprsidr wrote:
I made a few small changes to my theme.

There is the missing piece I needed!
You are using your theme, not a module to handle the watermark.

Knee jerk reaction is that this isn't what I want. I would like to be able to apply the embossing/watermarking regardless of the theme in use. I am currently supporting three different gallery instances. Each has its own theme. My son likes to change his theme on a fairly frequent (2-3 times per year). I don't want to have to "hack" each theme.

Thanks anyway.
Looks like some nice stuff.
I will look at it more closely even if I don't end up using it.

mike

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-10-30 03:36

Improved - properly sizing the watermark for each image thumbs/resizes/fullsize
This way you can allow full view and retain watermarking w/out damaging the full image.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2012-10-30 23:55

Suprsidr's approach is interesting, because it is genuinely on the fly, and as far as I can see you can't easily find the underlying unwatermarked image.

What I like about Mike's module is that it is a genuine watermark, not just a partially transparent overlay. The maths of creating a watermark while not simple is not all that hard either. I wonder if it could be incorporated into the canvas-based approach.

U-G

 
gxrodriguez

Joined: 2013-03-20
Posts: 1
Posted: Thu, 2013-04-04 10:34

hello I'm getting this problem

@todo UNREADABLE_FILE

Full error log:
Task Update photo embossing started (task id 12)
exception 'Exception' with message '@todo UNREADABLE_FILE' in /home/yage/public_html/gallery3/modules/gallery/helpers/photo.php:104
Stack trace:
#0 /home/yage/public_html/gallery3/modules/gallery/helpers/gallery_graphics.php(145): photo_Core::get_file_metadata('/home/yage/publ...')
#1 /home/yage/public_html/gallery3/modules/emboss/helpers/emboss_task.php(129): gallery_graphics_Core::composite('/home/yage/publ...', '/home/yage/publ...', Array)
#2 /home/yage/public_html/gallery3/modules/emboss/helpers/emboss_task.php(78): emboss_task_Core::do_embossing('1', '2', '1')
#3 [internal function]: emboss_task_Core::update_overlays(Object(Task_Model))
#4 /home/yage/public_html/gallery3/modules/gallery/helpers/task.php(90): call_user_func_array('emboss_task::up...', Array)
#5 /home/yage/public_html/gallery3/modules/gallery/controllers/admin_maintenance.php(194): task_Core::run('12')
#6 [internal function]: Admin_Maintenance_Controller->run('12')
#7 /home/yage/public_html/gallery3/modules/gallery/controllers/admin.php(62): call_user_func_array(Array, Array)
#8 [internal function]: Admin_Controller->__call('maintenance', Array)
#9 /home/yage/public_html/gallery3/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Admin_Controller), Array)
#10 [internal function]: Kohana_Core::instance(NULL)
#11 /home/yage/public_html/gallery3/system/core/Event.php(208): call_user_func_array(Array, Array)
#12 /home/yage/public_html/gallery3/application/Bootstrap.php(67): Event_Core::run('system.execute')
#13 /home/yage/public_html/gallery3/index.php(116): require('/home/yage/publ...')
#14 {main}
@todo UNREADABLE_FILE

Please help

 
bebebunny

Joined: 2013-04-21
Posts: 23
Posted: Sun, 2013-04-28 04:58

How to keep the image quality 100% ??

I notice right after embossing.. image quality decreased almost 50%..
Original image 84kb, after embossing 44kb + bad quality.

thanks