Skip to content

Commit

Permalink
Fix issue with image path
Browse files Browse the repository at this point in the history
  • Loading branch information
b123400 committed Dec 26, 2023
1 parent 4a85791 commit 10ad378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ext/fiparse/src/textinfo_hpricot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def handle_image(ptr, child)
if src =~ /^data:image\/(jp[e]?g|gif|png|x-[ew]mf);base64($|,)/
ptr.target.style = child[:style]
ext = $1
name_base = File.basename(@name.to_s.gsub(/®/, '').gsub(/[^A-z0-9]/, '_')).strip
name_base = File.basename((@title || @name).to_s.gsub(/®/, '').gsub(/[^A-z0-9]/, '_')).strip
file_name = File.join(name_base + '_files', "#{@image_index.to_s}.#{ext}")
lang = (@lang || 'de')
end
Expand Down
9 changes: 4 additions & 5 deletions src/plugin/text_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ def store_patinfo_change_diff(patinfo, lang, new_patinfo_lang)
if old_text.eql?(new_patinfo_lang.to_s)
LogFile.debug "store_patinfo_change_diff: #{lang} skip #{patinfo.odba_id} eql? #{old_text.eql?(new_patinfo_lang)} size #{old_size}"
else
diff_item = patinfo.description(lang).add_change_log_item(old_text, new_patinfo_lang)
new_patinfo_lang.change_log = patinfo.description(lang).change_log
new_patinfo_lang.add_change_log_item(old_text, new_patinfo_lang)
new_patinfo_lang.odba_store
patinfo.descriptions[lang] = new_patinfo_lang
patinfo.odba_store
LogFile.debug "store_patinfo_change_diff: #{lang} #{patinfo.odba_id} eql? #{old_text.eql?(new_patinfo_lang)} size #{old_size} -> #{patinfo.description(lang).change_log.size}"
end
Expand All @@ -314,10 +317,6 @@ def store_package_patinfo(package, lang, patinfo_lang)
package.patinfo.odba_store
end if package.patinfo && package.patinfo.is_a?(ODDB::Patinfo)
if package.patinfo && package.patinfo.is_a?(ODDB::Patinfo) && package.patinfo.descriptions[lang]
old_ti = package.patinfo; Languages.each do |old_lang|
next if old_lang.eql?(lang)
eval("package.patinfo.descriptions['#{old_lang}']= old_ti.descriptions['#{old_lang}']")
end
msg += ' change_diff'
store_patinfo_change_diff(package.patinfo, lang, patinfo_lang)
elsif package.patinfo && package.patinfo.is_a?(ODDB::Patinfo) && package.patinfo.descriptions.is_a?(Hash)
Expand Down

0 comments on commit 10ad378

Please sign in to comment.