![]() ![]() I started a 'security section' to the IM Examples API info area, which will appear in a day to two.īonzo, you especially better read and understand it, or copy and expand on it. Before passing such problem files to a shell command, or IM. The command line example is: convert image.png -font Arial -pointsize 20 -draw 'gravity south fill black. The problem is a file called 'I a lot.jpg' is a perfectly legal filename under UNIX, but a LOT of programs will have trouble handling it if those programs (like shell and IM) also do filename globbing.Īs a security measure it is often a good idea to error and abort if a filename has some unknown or unusual characters in it (like white space or glob meta-chars). The easiest type of textual watermark to create is a string overlay on top of the image. WARNING: As a security issue, you should watch out for filenames that contain 'glob' meta-characters too as both IM and Shells will try to re-expand them again. It lets you do the expansion into a list of files in PHP and then loop on them, rather than having either the shell, (or if you quoted the globbed filename) ImageMagick doing the filename expansion. That is the Command line shell method for handling and expanding the special 'shell filename meta-characters, like *, ?, and. With three images the thrid would have been a mask any you would have gotten unexpected results being saved in the LAST image filename you gave, overwriting that image.Īs for GLOB. ![]() The -draw in mogrify adds the needed extra image as an argument, outside the normal image processing sequence.Ĭomposite only wants two or three images only. Mogrify can NOT use -composite as it only deals with one image at a time. In your case it was probably that you escaped your quotes, making the parts of the draw string individual options, and NOT as SINGLE STRING.ĭraw only takes ONE STRING, for all the draw commands and arguments. That means the -draw did not see all the arguments and setting it needed for that drawing primative. Non-conforming drawing primitive definition ![]() If I can't find something this week I guess I'll just have to use PHP and loop over all of the files in the directory myself and perform the command on each file individually. I hope maybe the moderator Anthony will stumble over this post and give it a shot. There is a Gimp script that is specifically designed to add watermarks: Batch Image Watermark Script. It doesn't have to be perfect, but I don't want the overlaid image to be chopped off by the original frame dimensions of the base image, nor do I want the ovelaid image to become a small blip on the base image.Code: Select all mogrify: Non-conforming drawing primitive definition `.'. I would like to be able to maintain a fairly consistent ratio between the overlaid image with the base image. Nor would I want to have a 100x100 logo placed on 3000x3000 image. I surely don't want to place a 1000x1000 "branded" logo over top of a 300x300 base image. ![]() My question is, therefore, how to get the "branding" image to reflect (roughly) the dimensions of the base image. If need be, I can create a SVG for this purpose, so that it will scale without distortion. The image that will overlay the other will have a transparent background. I understand that ImageMagick does allow two images to be merged/combined, but I fail to find anything in the documentation that addresses how to scale one image (the overlaid branding logo) to match (roughly) the dimensions of the underlying image. The resulting new image will be of the same dimensions as the original base file. IOW, I want a new copy of the original base image with the branding/watermark placed on top of the new copy, saved off into a separate target folder. I have an image (JPG format) that I wish to "brand" (like a cowboy branding a cow) with a logo, center justified. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |