plugin/image_ex.rb in tdiary-contrib-5.0.13 vs plugin/image_ex.rb in tdiary-contrib-5.1.0
- old
+ new
@@ -1,5 +1,6 @@
+# coding: utf-8
# image_plugin_ex.rb
# version 0.3
# -pv-
#
# 名称:
@@ -84,15 +85,15 @@
@imageex_thumbnailsize = @options && @options['image_ex.previewsize'] || 120
@imageex_yearlydir = @options && @options['image_ex.yearlydir'] || 0
enable_js("image_ex.js")
-add_body_enter_proc(Proc.new do |date|
+add_body_enter_proc do |date|
@image_date = date.strftime("%Y%m%d")
@image_year = date.strftime("%Y")
""
-end)
+end
def image( id, alt = "image", id2 = nil, width = nil, place="none" )
@image_date ||= @date.strftime("%Y%m%d")
@image_year ||= @date.strftime("%Y")
@@ -197,10 +198,10 @@
imageex_convertedsize
else
imageex_convertedsize = %Q[#{imageex_convertedheight}x#{imageex_convertedwidth}]
imageex_convertedsize
end
- system(imageex_convertpath , "-geometry", imageex_convertedsize , orig, new)
+ system(imageex_convertpath , "-auto-orient", "-geometry", imageex_convertedsize , orig, new)
if FileTest::size?( new ) == 0
File::delete( new )
end
end
elsif imageex_useresize == 2