Permalink
Browse files

GetImageSize updates

  • Loading branch information...
1 parent d9117cf commit 6b06fcde098475ed496911bf14fe4e9537b011db @barbie committed Jun 19, 2011
View
@@ -1,5 +1,9 @@
Changes for the Labyrinth Core Plugins
+5.08 19/06/2011
+ - GetImageSize now used for articles.
+ - GetImageSize now used in Users::Item.
+
5.07 19/06/2011
- more documentation updates.
- expanded Sections functionality.
View
@@ -1,6 +1,6 @@
{
"name": "Labyrinth::Plugin::Core",
- "version": "5.07",
+ "version": "5.08",
"abstract": "Labyrinth Website Management Framework Core Plugins",
"author": [
"Barbie (BARBIE) <barbie@cpan.org>"
@@ -34,7 +34,7 @@
},
"runtime" : {
"requires" : {
- "Labyrinth": "5.07",
+ "Labyrinth": "5.08",
"Clone": "0",
"Config::IniFiles": "0",
@@ -51,59 +51,59 @@
"provides": {
"Labyrinth::Plugin::Articles": {
"file": "lib/Labyrinth/Plugin/Articles.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Articles::Sections": {
"file": "lib/Labyrinth/Plugin/Articles/Sections.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Articles::Site": {
"file": "lib/Labyrinth/plugin/Articles/Site.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Content": {
"file": "lib/Labyrinth/Plugin/Content.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Core": {
"file": "lib/Labyrinth/Plugin/Core.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Folders": {
"file": "lib/Labyrinth/Plugin/Folders.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Groups": {
"file": "lib/Labyrinth/Plugin/Groups.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Hits": {
"file": "lib/Labyrinth/Plugin/Hits.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Images": {
"file": "lib/Labyrinth/Plugin/Images.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Inbox": {
"file": "lib/Labyrinth/Plugin/Inbox.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Menus": {
"file": "lib/Labyrinth/Plugin/Menus.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::News": {
"file": "lib/Labyrinth/Plugin/News.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Users": {
"file": "lib/Labyrinth/Plugin/Users.pm",
- "version": "5.07"
+ "version": "5.08"
},
"Labyrinth::Plugin::Users::Info": {
"file": "lib/Labyrinth/Plugin/Users/Info.pm",
- "version": "5.07"
+ "version": "5.08"
}
},
"no_index": {
View
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Labyrinth::Plugin::Core
-version: 5.07
+version: 5.08
abstract: Labyrinth Website Management Framework Core Plugins
author:
- Barbie <barbie@cpan.org>
@@ -10,7 +10,7 @@ distribution_type: module
installdirs: site
requires:
- Labyrinth: 5.07
+ Labyrinth: 5.08
Clone: 0
Time::Local: 0
Image::Size: 0
@@ -31,46 +31,46 @@ build_requires:
provides:
Labyrinth::Plugin::Articles:
file: lib/Labyrinth/Plugin/Articles.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Articles::Sections:
file: lib/Labyrinth/Plugin/Articles/Sections.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Articles::Site:
file: lib/Labyrinth/Plugin/Articles/Site.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Content:
file: lib/Labyrinth/Plugin/Content.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Core:
file: lib/Labyrinth/Plugin/Core.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Folders:
file: lib/Labyrinth/Plugin/Folders.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Groups:
file: lib/Labyrinth/Plugin/Groups.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Hits:
file: lib/Labyrinth/Plugin/Hits.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Images:
file: lib/Labyrinth/Plugin/Images.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Inbox:
file: lib/Labyrinth/Plugin/Inbox.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Menus:
file: lib/Labyrinth/Plugin/Menus.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::News:
file: lib/Labyrinth/Plugin/News.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Users:
file: lib/Labyrinth/Plugin/Users.pm
- version: 5.07
+ version: 5.08
Labyrinth::Plugin::Users::Info:
file: lib/Labyrinth/Plugin/Users/Info.pm
- version: 5.07
+ version: 5.08
no_index:
directory:
View
@@ -4,7 +4,7 @@ WriteMakefile(
NAME => 'Labyrinth::Plugin::Core',
VERSION_FROM => 'lib/Labyrinth/Plugin/Core.pm',
PREREQ_PM => {
- 'Labyrinth' => '5.07',
+ 'Labyrinth' => '5.08',
'Clone' => 0,
'Time::Local' => 0,
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Articles;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -324,25 +324,7 @@ sub Item {
($body->{tag},$body->{width},$body->{height}) = split(qr/\|/,$body->{body})
if($body->{body});
- unless(defined $body->{width} || defined $body->{height}) {
- ($body->{width},$body->{height}) = split('x',$rows[0]->{dimensions})
- if($rows[0]->{dimensions});
- }
-
- # long winded to avoid uninitialised variable errors
- if(defined $body->{width} && defined $body->{height} && $body->{width} > $body->{height} && $body->{width} > 400) {
- $body->{width} = 400;
- delete $body->{height};
- } elsif(defined $body->{width} && defined $body->{height} && $body->{width} < $body->{height} && $body->{height} > 400) {
- $body->{height} = 400;
- delete $body->{width};
- } elsif(defined $body->{width} && $body->{width} > 400) {
- $body->{width} = 400;
- delete $body->{height};
- } elsif(defined $body->{height} && $body->{height} > 400) {
- $body->{height} = 400;
- delete $body->{width};
- }
+ ($body->{width},$body->{height}) = GetImageSize($body->{link},$rows[0]->{dimensions},$body->{width},$body->{height},MaxArticleWidth,MaxArticleHeight);
#LogDebug(sprintf "%d/%s [%d x %d]", ($body->{imageid}||0),($body->{link}||'-'),($body->{width}||0),($body->{height}||0));
}
@@ -534,13 +516,7 @@ sub Edit {
$body->{ddalign} = AlignSelect($body->{align},$orderno);
$body->{align} = Alignment($body->{align});
- unless(defined $body->{width} || defined $body->{height}) {
- ($body->{width},$body->{height}) = split('x',$rows[0]->{dimensions});
- }
- if($body->{width} > 400) {
- $body->{width} = 400;
- delete $body->{height};
- }
+ ($body->{width},$body->{height}) = GetImageSize($body->{link},$rows[0]->{dimensions},$body->{width},$body->{height},MaxArticleWidth,MaxArticleHeight);
LogDebug("$body->{imageid}/$body->{link} [$body->{width} x $body->{height}]");
}
@@ -4,7 +4,7 @@ use warnings;
use strict;
use vars qw($VERSION $ALLSQL $SECTIONID);
-$VERSION = '5.07';
+$VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Articles::Site;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Content;
use strict;
use warnings;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Core;
use warnings;
use strict;
-our $VERSION = '5.07';
+our $VERSION = '5.08';
1;
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Folders;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Groups;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Hits;
use strict;
use warnings;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Images;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Inbox;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Menus;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::News;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Users;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME
@@ -135,6 +135,7 @@ sub UserLists {
for(@rows) {
($_->{width},$_->{height}) = GetImageSize($_->{link},$_->{dimensions},$_->{width},$_->{height},MaxUserWidth,MaxUserHeight);
+ $_->{gravatar} = GetGravatar($_->{userid},$_->{email});
if($_->{url} && $_->{url} !~ /^https?:/) {
$_->{url} = 'http://' . $_->{url};
@@ -153,8 +154,6 @@ sub UserLists {
} else {
$_->{name} = $_->{nickname} || $_->{realname};
}
-
- $_->{gravatar} = GetGravatar($_->{userid},$_->{email});
}
$tvars{users} = \@rows if(@rows);
@@ -182,10 +181,12 @@ sub Item {
my @rows = $dbi->GetQuery('hash','GetUserByID',$cgiparams{'userid'});
return unless(@rows);
+ $rows[0]->{tag} = '' if($rows[0]->{link} =~ /blank.png/);
+ $rows[0]->{link} = '' if($rows[0]->{link} =~ /blank.png/);
+
+ ($rows[0]->{width},$rows[0]->{height}) = GetImageSize($rows[0]->{link},$rows[0]->{dimensions},$rows[0]->{width},$rows[0]->{height},MaxUserWidth,MaxUserHeight);
$rows[0]->{gravatar} = GetGravatar($rows[0]->{userid},$rows[0]->{email});
- $rows[0]->{tag} = '' if($rows[0]->{link} =~ /blank.png/);
-# $rows[0]->{tag} = '[No Image]' if($rows[0]->{link} =~ /blank.png/);
$tvars{data} = $rows[0];
}
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Users::Info;
use warnings;
use strict;
-my $VERSION = '5.07';
+my $VERSION = '5.08';
=head1 NAME

0 comments on commit 6b06fcd

Please sign in to comment.