caxlsx: Images don't work

I’m using Ruby 2.6.6-1-x64 on Windows and caxlsx 3.0.1. The images do not appear on the worksheet. It seems that the images are only partially copied in subfolder xl/media of xlsx file. If I simply swap to the axlsx library, everything works again.

Example:

#require 'axlsx'
require 'caxlsx'

p = Axlsx::Package.new

p.workbook.add_worksheet(:name => "Basic Worksheet") do |sheet|
  
  sheet.add_row ["First Column", "Second", "Third"]
  sheet.add_row [1, 2, 3]
  
  img = 'image1.jpeg'
  sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"https://github.com/caxlsx/caxlsx") do |image|
    image.width=720
    image.height=666
    image.hyperlink.tooltip = "Labeled Link"
    image.start_at 1, 5
  end
  
end

p.use_shared_strings = true
p.serialize('simple.xlsx')

simple.xlsx

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Sounds good. Once testing passes I’ll bump the version number and release.