Konstrukt

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

		'Clone'                  => '0.2',
		'CGI'                    => '3',
		'Cwd'                    => '0',
		'Date::Calc'             => '5.4',
		'DateTime'               => '0.2',
		'DateTime::Format::Mail' => '0.28',
		'DBI'                    => '1.4',
		'Devel::UseAnyFunc'      => '1',
		'Digest::SHA'            => '5.32',
		'HTTP::BrowserDetect'    => '0.98',
		'Image::Magick'          => '6.2.4',
		'MIME::Base64'           => '3',
		'POSIX'                  => '1',
		'Session'                => '0.01',
		'Storable'               => '2.1',
		'Text::Diff'             => '0.35',
		'Time::HiRes'            => '1.5',
		'Time::Local'            => '1',
		'Time::Zone'             => '2',
	},
	recommends => {

META.yml  view on Meta::CPAN

  CGI: 3
  Clone: 0.2
  Cwd: 0
  DBI: 1.4
  Date::Calc: 5.4
  DateTime: 0.2
  DateTime::Format::Mail: 0.28
  Devel::UseAnyFunc: 1
  Digest::SHA: 5.32
  HTTP::BrowserDetect: 0.98
  Image::Magick: 6.2.4
  MIME::Base64: 3
  POSIX: 1
  Session: 0.01
  Storable: 2.1
  Text::Diff: 0.35
  Time::HiRes: 1.5
  Time::Local: 1
  Time::Zone: 2
  perl: 5.6.1
build_requires:

lib/Konstrukt/Doc/Installation.pod  view on Meta::CPAN

	# cpan
	cpan> install Some::Module

You may also specify the modules you want to install at the command line:

	# cpan Some::Module

So a shortcut to install a recommended set of modules would be

	# cpan Module::Build CGI Storable Time::HiRes Scalar::Util::Clone Session DBI DBD::mysql \
	Data::Dump Date::Calc Digest::SHA HTTP::BrowserDetect Image::Magick \
	Text::Diff Time::Local Time::Zone

Note that it might be better to install some modules from the package manager
of your operating system.

On Debian for example there are several packages for common perl modules
available (e.g. Image::Magick -> perlmagick; DBD::mysql ->
lib-dbd-mysql-perl; DBI -> libdbi-perl; CGI -> libCGI-perl; Apache ->
libapache-dbi-perl, libapache-request-perl, libapache-session-perl;
Apache2 -> libapache2-mod-apreq2, libapache2-mod-perl2).

On some systems you might have to call CPAN via a perl command:

	# perl -MCPAN -e shell

=head2 Windows notes

lib/Konstrukt/Doc/Installation.pod  view on Meta::CPAN

B<Dependencies of some plugins:>

=over

=item * Date::Calc

=item * Digest::SHA

=item * HTTP::BrowserDetect

=item * Image::Magick

=item * Text::Diff

=item * Time::Local

=back

=head2 Local Module installation (non-root)

Basically the same as above, with some differences:

lib/Konstrukt/Plugin/wiki/backend/image/DBI.pm  view on Meta::CPAN


=cut

package Konstrukt::Plugin::wiki::backend::image::DBI;

use strict;
use warnings;

use base 'Konstrukt::Plugin::wiki::backend::image';

use Image::Magick;

=head1 METHODS

=head2 new

=head2 init

Initialization of this class. Loads the settings.

=cut

lib/Konstrukt/Plugin/wiki/backend/image/DBI.pm  view on Meta::CPAN

		if (@{$result}) {
			return $result->[0];
		} else {
			#get original image, resize the image, save the resized image
			$query = "SELECT content, mimetype, width, height, original FROM wiki_image_content WHERE title = $qtitle AND revision = $qcontent_revision AND width = $qoriginal_width";
			$result = $dbh->selectall_arrayref($query, { Columns=>{} });
			if (@{$result}) {
				#resize the image
				my $image = $result->[0];
				#load image
				my $im = Image::Magick->new();
				$im->BlobToImage($image->{content});
				#resize
				my ($old_width, $old_height) = $im->Get('width', 'height');
				my $aspect = $old_width / $old_height;
				my $height = $width / $aspect;
				$im->Resize(width => $width, height => $height, blur => 0.8);
				$image->{content} = $im->ImageToBlob(quality => $Konstrukt::Settings->get("wiki/image_quality"));
				if (defined $image->{content}) {
					$image->{width} = $width;
					$image->{height} = $height;

lib/Konstrukt/Plugin/wiki/backend/image/DBI.pm  view on Meta::CPAN

		}
		
		#modify image content?
		if (defined $store_content) {
			#new image content?
			if (defined $content) {
				#get current entry and check if the new entry differs
				my $current = $self->get_content($title);
				if (not defined $current->{content} or $current->{content} ne $content) {
					#load image
					my $im = Image::Magick->new();
					$im->BlobToImage($content);
					#successfully loaded?
					if (defined $im->[0]) {
						#get mimetype if not defined
						$mimetype = $im->Get('MIME') unless defined $mimetype;
						#get size
						my($width, $height) = $im->Get('width', 'height');
						#create entry
						my $query = "INSERT INTO wiki_image_content(title, content, width, height, mimetype, original) values (?, ?, ?, ?, ?, 1);";	
						my $sth = $dbh->prepare($query);



( run in 0.380 second using v1.01-cache-2.11-cpan-beeb90c9504 )