10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies
2. Solaris
Problem occurs on one Solaris build. Every time we unzip the Jan CPU, there are several patches that error out (appears to be related to the GIF files). When we unzip the CPU on another Solaris build to a network storage area, we can execute without issue on the original machine.
Any ideas?
... (1 Reply)
Discussion started by: grahamr72
1 Replies
3. Web Development
I have an apache/2.2.15 server centos 6.3
The apache server will be serving jboss app via mod_proxy (got that working)
But... I need to serve the images from a local directory on the apache server. Here is my configuration. When I got to the site, I get 404s for all the images.
What am I... (5 Replies)
Discussion started by: kmaq7621
5 Replies
4. Shell Programming and Scripting
My department uses an outlook mail merge to send login information to multiple users who request access. I would like to use sendmail for obvious reasons. I copied a sample email source, with all the disgusting html formatting from outlook, and can successfully send emails almost exactly as I did... (0 Replies)
Discussion started by: MaindotC
0 Replies
5. Web Development
Hi,
I am trying to help my friend with her website, trying to update this GIF file, I am having so much hard time. Please advice.
I have uploaded the GIF file for your review. She wants to keep the same color but just change the scheudle around. It looks so simple but not sure why it's... (3 Replies)
Discussion started by: samnyc
3 Replies
6. Shell Programming and Scripting
Hi, Dear all:
One question ! ^_^
I'm using bash under Ubuntu 9.10.
My question is not to rename all ".JPG" files to ".jpg" in a single folder, but to rename all ".JPG" files to ".jpg" in all subfolders.
To rename all ".JPG" to ".jpg" in a single folder,
for x in *.JPG; do mv "$x"... (7 Replies)
Discussion started by: jiapei100
7 Replies
7. UNIX for Dummies Questions & Answers
Hi Everyone,
I am trying to use "convert" to create a movie from .bmp files. I have about 100 .bmp files which I would like to include. I use the following command:
convert *.bmp test.gif
The problem is that on the cluster I am using there doesn't seem to be enough memory to do this.... (1 Reply)
Discussion started by: jenjen_mt
1 Replies
8. Shell Programming and Scripting
Like class loader in java, can we make a function loader in shell script, for this can someone throw some light on how internally bash runs a shell script , what happenes in runtime ...
thanks in advance.. (1 Reply)
Discussion started by: mpsc_sela
1 Replies
9. UNIX for Advanced & Expert Users
i am having a hard time loading the php4.module onto the apache 2.0 server that I am running.. i have tried to load it statically and through an install and stiill can't seem to connect to localhost through any of the ports that the manual suggested 80 8000 8080.. so far i have manged to load... (2 Replies)
Discussion started by: moxxx68
2 Replies
10. UNIX for Dummies Questions & Answers
Hello.
I have a large number of EPS files and a lesser number of PDFs that I need to convert to GIFs/JPGs using a Unix system. Is there a unix utility or application out there that can do this conversion?
Thank you in advance for any help you can provide.
-Pook (1 Reply)
Discussion started by: PookJP
1 Replies
Template::Plugin::Image(3pm) User Contributed Perl Documentation Template::Plugin::Image(3pm)
NAME
Template::Plugin::Image - Plugin access to image sizes
SYNOPSIS
[% USE Image(filename) %]
[% Image.width %]
[% Image.height %]
[% Image.size.join(', ') %]
[% Image.attr %]
[% Image.tag %]
DESCRIPTION
This plugin provides an interface to the Image::Info or Image::Size modules for determining the size of image files.
You can specify the plugin name as either '"Image"' or '"image"'. The plugin object created will then have the same name. The file name
of the image should be specified as a positional or named argument.
[% # all these are valid, take your pick %]
[% USE Image('foo.gif') %]
[% USE image('bar.gif') %]
[% USE Image 'ping.gif' %]
[% USE image(name='baz.gif') %]
[% USE Image name='pong.gif' %]
A "root" parameter can be used to specify the location of the image file:
[% USE Image(root='/path/to/root', name='images/home.png') %]
# image path: /path/to/root/images/home.png
# img src: images/home.png
In cases where the image path and image url do not match up, specify the file name directly:
[% USE Image(file='/path/to/home.png', name='/images/home.png') %]
The "alt" parameter can be used to specify an alternate name for the image, for use in constructing an XHTML element (see the "tag()"
method below).
[% USE Image('home.png', alt="Home") %]
You can also provide an alternate name for an "Image" plugin object.
[% USE img1 = image 'foo.gif' %]
[% USE img2 = image 'bar.gif' %]
The "name" method returns the image file name.
[% img1.name %] # foo.gif
The "width" and "height" methods return the width and height of the image, respectively. The "size" method returns a reference to a 2
element list containing the width and height.
[% USE image 'foo.gif' %]
width: [% image.width %]
height: [% image.height %]
size: [% image.size.join(', ') %]
The "modtime" method returns the modification time of the file in question, suitable for use with the Date plugin, for example:
[% USE image 'foo.gif' %]
[% USE date %]
[% date.format(image.modtime, "%B, %e %Y") %]
The "attr" method returns the height and width as HTML/XML attributes.
[% USE image 'foo.gif' %]
[% image.attr %]
Typical output:
width="60" height="20"
The "tag" method returns a complete XHTML tag referencing the image.
[% USE image 'foo.gif' %]
[% image.tag %]
Typical output:
<img src="foo.gif" width="60" height="20" alt="" />
You can provide any additional attributes that should be added to the XHTML tag.
[% USE image 'foo.gif' %]
[% image.tag(class="logo" alt="Logo") %]
Typical output:
<img src="foo.gif" width="60" height="20" alt="Logo" class="logo" />
Note that the "alt" attribute is mandatory in a strict XHTML "img" element (even if it's empty) so it is always added even if you don't
explicitly provide a value for it. You can do so as an argument to the "tag" method, as shown in the previous example, or as an argument
[% USE image('foo.gif', alt='Logo') %]
CATCHING ERRORS
If the image file cannot be found then the above methods will throw an "Image" error. You can enclose calls to these methods in a
"TRY...CATCH" block to catch any potential errors.
[% TRY;
image.width;
CATCH;
error; # print error
END
%]
USING Image::Info
At run time, the plugin tries to load Image::Info in preference to Image::Size. If Image::Info is found, then some additional methods are
available, in addition to "size", "width", "height", "attr", and "tag". These additional methods are named after the elements that
Image::Info retrieves from the image itself. The types of methods available depend on the type of image (see Image::Info for more details).
These additional methods will always include the following:
file_media_type
This is the MIME type that is appropriate for the given file format. The corresponding value is a string like: ""image/png"" or
""image/jpeg"".
file_ext
The is the suggested file name extention for a file of the given file format. The value is a 3 letter, lowercase string like ""png"",
""jpg"".
color_type
The value is a short string describing what kind of values the pixels encode. The value can be one of the following:
Gray
GrayA
RGB
RGBA
CMYK
YCbCr
CIELab
These names can also be prefixed by ""Indexed-"" if the image is composed of indexes into a palette. Of these, only ""Indexed-RGB"" is
likely to occur.
(It is similar to the TIFF field PhotometricInterpretation, but this name was found to be too long, so we used the PNG inpired term
instead.)
resolution
The value of this field normally gives the physical size of the image on screen or paper. When the unit specifier is missing then this
field denotes the squareness of pixels in the image.
The syntax of this field is:
<res> <unit>
<xres> "/" <yres> <unit>
<xres> "/" <yres>
The "<res>", "<xres>" and "<yres>" fields are numbers. The "<unit>" is a string like "dpi", "dpm" or "dpcm" (denoting "dots per
inch/cm/meter).
SamplesPerPixel
This says how many channels there are in the image. For some image formats this number might be higher than the number implied from the
"color_type".
BitsPerSample
This says how many bits are used to encode each of samples. The value is a reference to an array containing numbers. The number of
elements in the array should be the same as "SamplesPerPixel".
Comment
Textual comments found in the file. The value is a reference to an array if there are multiple comments found.
Interlace
If the image is interlaced, then this returns the interlace type.
Compression
This returns the name of the compression algorithm is used.
Gamma
A number indicating the gamma curve of the image (e.g. 2.2)
AUTHOR
Andy Wardley <abw@wardley.org> <http://wardley.org/>
COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin, Image::Info
perl v5.14.2 2011-12-20 Template::Plugin::Image(3pm)