Actions
Defect #16422
closedIn attachment.rb thumbnail function could not return target correct
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
No feedback
Affected version:
Description
In the lines from 200 to 207
begin
Redmine::Thumbnail.generate(self.diskfile, target, size) # <== could not return target success, even if target is correct.
rescue => e
logger.error "An error...."
return nil
end
add return target
begin
Redmine::Thumbnail.generate(self.diskfile, target, size)
return target # <== it's correct on my site
rescue => e
logger.error "An error...."
return nil
end
Updated by Jean-Philippe Lang about 11 years ago
- Status changed from New to Needs feedback
Could you describe under which conditions it fails to return the target?
Updated by chih-jen chuang about 11 years ago
My environment
OS: ubuntu 12.04
ruby: rvm install ruby 1.9.3p484 rails 3.2.7
database: postgresql 9.1.12
redmine: 2.5.0.stable
ImageMagick: 6.6.9-7
Conditions:
I have a issue with image attachment, but can't see thumbnail of that image.
I trace the code and found the problem in my computer.
Updated by Toshi MARUYAMA about 11 years ago
- Category changed from Issues to Attachments
Updated by Toshi MARUYAMA about 11 years ago
It's strange.
http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Method_Calls#Return_Values
Methods return the value of the last statement executed.
$ irb 1.9.3-p545 :001 > def test 1.9.3-p545 :002?> begin 1.9.3-p545 :003 > 1 1.9.3-p545 :004?> rescue => e 1.9.3-p545 :005?> return nil 1.9.3-p545 :006?> end 1.9.3-p545 :007?> end => nil 1.9.3-p545 :008 > test => 1
Updated by Toshi MARUYAMA about 11 years ago
It seems you modify Redmine::Thumbnail#generate
source:tags/2.5.1/lib/redmine/thumbnail.rb#L41
Updated by Jean-Philippe Lang about 10 years ago
- Status changed from Needs feedback to Closed
- Resolution set to No feedback
Actions