Page 1 of 1
Watermark top tif only
Posted: 2014-06-20T07:29:41-07:00
by cappsie
Hi,
I thought I'd start a different thread with this question. Can I watermark just the top tif image? I found this thread:
viewtopic.php?t=23965 which seems close to what I want to do, only that one suggests cloning, deleting and recreating. Surely that wouldn't be necessary if I only wanted to watermark the top or first-only image?
The tiff could be one image or perhaps as many as 10.
Thoughts?
A.
Re: Watermark top tif only
Posted: 2014-06-20T07:38:04-07:00
by Bonzo
Try adding [0] to your tiff file e.g. input.tif[0]
Re: Watermark top tif only
Posted: 2014-06-20T08:07:51-07:00
by cappsie
I'm not entirely sure where to put the [0] against or after a variable. I keep getting odd errors as if ImageMagick is attempting to read in the first character of the path...
Where would you put it in this line (if at all in this line):
Code: Select all
$cmd = "$original_image -font C:/Windows/Fonts/ARIAL.TTF -fill rgba(0,0,0,0.5) -pointsize 100 -gravity NorthEast -annotate 0x0+0+0 \"$text_submitted\" -write $output\\$new_image -write $text_submitted.jpg ";
Thanks,
Adam.
Re: Watermark top tif only
Posted: 2014-06-20T09:22:13-07:00
by Bonzo
Code: Select all
$original image = 'input.tif[0]';
$cmd = "$original_image -font C:/Windows/Fonts/ARIAL.TTF -fill rgba(0,0,0,0.5) -pointsize 100 -gravity NorthEast -annotate 0x0+0+0 \"$text_submitted\" -write $output\\$new_image -write $text_submitted.jpg ";
Re: Watermark top tif only
Posted: 2014-06-20T15:33:44-07:00
by cappsie
Bonzo wrote:Code: Select all
$original image = 'input.tif[0]';
$cmd = "$original_image -font C:/Windows/Fonts/ARIAL.TTF -fill rgba(0,0,0,0.5) -pointsize 100 -gravity NorthEast -annotate 0x0+0+0 \"$text_submitted\" -write $output\\$new_image -write $text_submitted.jpg ";
How can I do that if the $original_image is a variable and not explicitly defined as in your example?
Edit: I should add that my image is defined thus:
Code: Select all
$original_image = $_FILES['filename']['tmp_name'];
A.
Re: Watermark top tif only
Posted: 2014-06-23T04:00:38-07:00
by cappsie
Hi again,
Right ignore the last one; I'm not going to need it.
The new issue is accepting an input from a dropdown list and adding that to the watermark. I've tried declaring it thus:
Code: Select all
// Cleanup the text.
$text_submitted = clean ( $_POST['text_submitted'], 18 );
$clinic_submitted = clean ( $_POST['clinic_submitted '], 18 );
$staff_submitted = clean ( $_POST['staff_submitted '], 18 );
Then calling it:
Code: Select all
$cmd = "$original_image -font C:/Windows/Fonts/ARIAL.TTF -fill rgba(0,0,0,0.5) -pointsize 100 -gravity NorthEast -annotate 0x0+0+0 \"$text_submitted\\$clinic_submitted\\$staff_submitted\" -write $output\\$text_submitted\"-\"$new_image ";
The HTML form:
Code: Select all
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">
<label>Select file for grading</label>
<input type="file" name="filename" /><BR /><BR />
<input type="text" name="text_submitted" value="Graded <?php echo date('d-m-Y'); ?>"/>
<select>
<option value="AUD1S" name="clinic_submitted">AUD1S</option>
<option value="AUD2L" name="clinic_submitted">AUD2L</option>
<option value="AUD3A" name="clinic_submitted">AUD3A</option>
<option value="AUD4M" name="clinic_submitted">AUD4M</option>
<option value="AUD4A" name="clinic_submitted">AUD4A</option>
<option value="AUD5M" name="clinic_submitted">AUD5M</option>
<option value="AUD3B" name="clinic_submitted">AUD3B</option>
<option value="AUD4B" name="clinic_submitted">AUD4B</option>
<option value="TIN1M" name="clinic_submitted">TIN1M</option>
<option value="TIN2B" name="clinic_submitted">TIN2B</option>
</select>
<select>
<option value="John Smith" name="staff_submitted">John Smith</option>
<option value="OTHER" name="staff_submitted">OTHER</option>
</select>
<input type="Submit" name="Submit" value="Grade File" />
<BR /><BR /><BR />
</form>
Any thoughts?
Thanks,
A.
Re: Watermark top tif only
Posted: 2014-06-25T02:42:31-07:00
by cappsie
No problems, all sorted
