summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2009-08-28 20:34:10 +0000
committerRalph Amissah <ralph@amissah.com>2009-08-28 20:34:10 +0000
commita3e1f8bf328199b15abad680e0f7abbf284d8cd1 (patch)
tree145396ea5ee454ed2c6cf71f265d040f3c17fdf1
parentsha256 for 0.71.2 (diff)
downloadsisu-a3e1f8bf328199b15abad680e0f7abbf284d8cd1.zip
sisu-a3e1f8bf328199b15abad680e0f7abbf284d8cd1.tar.xz
dal images, where rmagick cannot be loaded use imagemagick directly if availablesisu_0.71.3
-rw-r--r--CHANGELOG9
-rw-r--r--conf/sisu/version1.yml6
-rw-r--r--lib/sisu/v1/dal_images.rb15
3 files changed, 23 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 79e7830..82c5ba5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,15 @@ Reverse Chronological:
%% STABLE MANIFEST
+%% sisu_0.71.3.orig.tar.gz (2009-08-28:34/5)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.3.orig.tar.gz
+ sisu_0.71.3.orig.tar.gz
+ sisu_0.71.3-1.dsc
+ sisu_0.71.3-1.diff.gz
+
+ * fix to use imagemagick directly (when imagemagick is available and rmagick
+ declares versions not in sync)
+
%% sisu_0.71.2.orig.tar.gz (2009-08-02:30/7)
http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.2.orig.tar.gz
220199cbc435ec6d246af4ac43a2ef6a3e05f649847c4ee04b831af1e8ad4902 1548875 sisu_0.71.2.orig.tar.gz
diff --git a/conf/sisu/version1.yml b/conf/sisu/version1.yml
index 6310638..b0cb9ae 100644
--- a/conf/sisu/version1.yml
+++ b/conf/sisu/version1.yml
@@ -1,5 +1,5 @@
---
-:version: 0.71.2
-:date_stamp: 2009w30/7
-:date: "2009-08-02"
+:version: 0.71.3
+:date_stamp: 2009w34/5
+:date: "2009-08-28"
:project: SiSU
diff --git a/lib/sisu/v1/dal_images.rb b/lib/sisu/v1/dal_images.rb
index 6789302..1882aea 100644
--- a/lib/sisu/v1/dal_images.rb
+++ b/lib/sisu/v1/dal_images.rb
@@ -67,7 +67,11 @@ module SiSU_images
@rmgk=false
imagemagick_=SiSU_Env::Info_settings.new.program?('rmagick')
if imagemagick_
- @rmgk=SiSU_Env::Load.new('RMagick').prog
+ begin
+ @rmgk=SiSU_Env::Load.new('RMagick').prog
+ rescue
+ @rmgk=false
+ end
else
if @md.cmd =~/[vVM]/
tell=SiSU_Screen::Ansi.new(@md.cmd,'use of RMagick is not enabled in sisurc.yml')
@@ -81,6 +85,7 @@ module SiSU_images
m=/#{Mx[:lnk_o]}\s*(\S+\.(?:png|jpg|gif))/
if imagemagick_
imgs=para.scan(m).flatten
+ img_col=img_row=nil
images=imgs.each do |image|
dir=SiSU_Env::Info_env.new(@md.fns)
path_image=[dir.path.image_source_local_tex,dir.path.image_source_remote_tex,dir.path.image_source_tex]
@@ -101,19 +106,21 @@ module SiSU_images
img_col,img_row=/(\d+)x(\d+)/m.match(imgsys)[1,2]
img_col,img_row=img_col.to_i,img_row.to_i
end
+ row=(img && defined? img.rows) ? img.rows : img_row
+ col=(img && defined? img.columns) ? img.columns : img_col
if img_col > img_row #landscape
if img_col> 640 #480
img_col=640 #480
- img_row=((1.00*img_col/img.columns)*img.rows).round
+ img_row=((1.00*img_col/col)*row).round
end
else #portrait
if img_col> 640 #480
img_col=640 #480
- img_row=((1.00*img_col/img.columns)*img.rows).round
+ img_row=((1.00*img_col/col)*row).round
end
if img_row > 640
img_row=640
- img_col=((1.00*img_row/img.rows)*img.columns).round
+ img_col=((1.00*img_row/row)*col).round
end
end
para.gsub!(/(#{image})/,"#{image} #{img_col}x#{img_row}")