Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with image path #232

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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