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

problems getting hyperlink info and images from specified worksheets #486

Open
nathanaelhuffman opened this issue Jan 28, 2025 · 0 comments

Comments

@nathanaelhuffman
Copy link

First off, thanks for this library I've been using it in a number of places to deal with xlsx files of varying types, being able to loop rows and pass stuff to serde etc has all been really awesome!

I did run into a stumbling block on a recent project and had to bail out to another library to deal with some of the features I needed as I couldn't get this information out just using calamine.

I unfortunately have an xlsx template that has a varying number of images pasted onto different sheets, and hyperlinks on the first sheet that link
to the corresponding image. Each of these images is associated with some text in cells on that first sheet, think issue tracker with issue text and metadata on the first sheet linking to supporting images on subsequent sheets.

Problem 1: I can't read the raw hyperlink info in the link cells on the original sheet. The hyperlinks in the cell have a display text set to "Image" but the link links to ! so like "Sheet 2!A1", but calamine only shows Some("Image") which is the text representation for these cells. This is problematic as I can't figure out where the link goes. Maybe related to #360 ?

Problem 2: the image support in calamine it far too simplistic for anything but basic image export. Even with the "pictures" feature, while you can get the image data, the only metadata you get with it is its image type (jpg, png etc), no information about the image name in the zip, no information about which cells reference this etc.

Both of these problems conspire to make it so that I'm unable to figure out which image is on which sheet, and which issue links to which sheet (and thus which image) with just calamine alone.

For a possible implementation reference, I really like calamine's API for most of my other processing but I bailed out to umya-spreadsheet
and used the get_hyperlink function on their cell type to get the hyperlink info on the link cells and then used get_image to get the image data from the specified link cells.

It would be really awesome to have similar API functionality in calamine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant