New to imagemagick. Can't figure out a task I want to do.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo »

I would think you need something like this but it does not work !

If I get time and nobody else comes up with an answer I will have another look at it.

Anthony

Code: Select all

<!doctype html public "-//W3C//DTD HTML 4.01//EN">
<html>
   <head>
      <title>Table of images</title>
   </head>
<body>

<?php

// Directory containing the images - need the trailing slash /
$read = 'photos/';
  
// Open the directory and create an array of the images
$myDirectory = opendir($read);
  
while($entryName = readdir($myDirectory))
{
// This will only select jpg images from the folder
if (strtolower(substr($entryName, -3)) == "jpg")
$dirArray[]=$entryName;
}
    
closedir($myDirectory);
 
// Count the number of images
$indexCount = count($dirArray);
  
for ($i=0; $i<$indexCount; $i++)
{

$name[$i] = $read.$dirArray[$i];

exec("/usr/local/bin/composite -gravity southeast scale.gif {$name[$i]} {$name[$i]}"); 

}

?>

</body>
</html>

ridera

Post by ridera »

mogrify or same name in and out, I think.

Be certain you have a good backup.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

For how too.. See IM Examples, Annotating Images
http://www.cit.gu.edu.au/~anthony/graph ... nnotating/

their are lots of examples. It is then just a matter of looping over your images Which you should have made a seperate backup of.
See final looping suggetions in mogrify notes
http://www.cit.gu.edu.au/~anthony/graph ... s/#mogrify
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply