GithubHelp home page GithubHelp logo

Comments (9)

btargac avatar btargac commented on June 22, 2024

Hi @CavalloScuro thanks for reaching out, trying the app and giving feedbacks about possible improvements.

In your case urls without an extension brings a problem on saving to filesystem (with which filename and extension to save) but I think it can be handled with the server response header (via parsing the mime type)

Can you supply a small set of image resources without file extensions to make the testing easier?

Kind regards

from excel-parser-processor.

CavalloScuro avatar CavalloScuro commented on June 22, 2024

Dear Burak,

Thank you for responding so quickly and so kindly to my inquiry. As I mentioned, I'm really impressed with your tool, which will be an enormous (invaluable, really) resource for my research.

The URLs that I am dealing with right now look like this:

http://digitale.bnc.roma.sbn.it/tecadigitale/img/giornale/TO00181645/1935/unico/00000001/original
http://digitale.bnc.roma.sbn.it/tecadigitale/img/giornale/TO00181645/1935/unico/00000002/original
http://digitale.bnc.roma.sbn.it/tecadigitale/img/giornale/TO00181645/1935/unico/00000003/original
http://digitale.bnc.roma.sbn.it/tecadigitale/img/giornale/TO00181645/1935/unico/00000004/original
http://digitale.bnc.roma.sbn.it/tecadigitale/img/giornale/TO00181645/1935/unico/00000005/original

There is no way, that I know of, to get an absolute path to the jpg itself; I have only been able to find these URLs which are essentially HTML websites with the .jpg embedded inside of them. But when one performs the Save As function, it saves the file as a .jpg (at least in my browser). The problem, of course, is automation!

I thank you for being willing to look into this solution. It means a lot. And thanks for your hard work.

CS

from excel-parser-processor.

CavalloScuro avatar CavalloScuro commented on June 22, 2024

I just had an idea: I wonder if I could just put the .jpg extensions in the "FileName" column of the spreadsheet, which would then become the full file name when the Parser assigns the extensionless file a file name. Am I off here, or could this be a possible solution?

from excel-parser-processor.

btargac avatar btargac commented on June 22, 2024

Yeah that could work of course;

But that could require some extra work to prepare the excel file in cases where you can not guess the extension or if the resource changes from png to jpg on the server, or if they serve the image with an image CDN they can check your request headers and send webP, avif or any other modern extension due to your headers( in this case embedded chromiums user agent), so the most convenient way seems to rely on the server response's mime type and save with that extension on the filesystem.

This task won't take a long time, I guess next week I'll have some spare time to work on 👨‍💻

from excel-parser-processor.

CavalloScuro avatar CavalloScuro commented on June 22, 2024

I thank you so much, Burak! Very kind!

from excel-parser-processor.

btargac avatar btargac commented on June 22, 2024

Hi @CavalloScuro ,

I looked for the mimeType solution but we have missed some other problem,

every file ends with the name original so when the job is completed you only have one file and its the last one on the excel file since it always over writes the last file with the same name :)

so I guess you should also have a column B (which is currently supported, it can contain an extension or not in your case).

for example;

|    | A                                             | B            | C                         |
| ---| :---------------------------------------------| :------------| :-------------------------|
| 1  | http://.................../00000001/original  | optional1    | optional-sub-folder-name  |
| 2  | http://.................../00000002/original  | optional2    | optional-sub-folder-name  |
| 3  | http://.................../00000003/original  | optional3.png|                           |
| .  | ...                                           |              |                           |
| .  | ...                                           |              |                           |

so if the column B contains an extension that will be used, but if not mimeType from the response will be used, does that sound good to you ?

from excel-parser-processor.

CavalloScuro avatar CavalloScuro commented on June 22, 2024

Dear Burak,

Thank you very much for taking the time to look into this and making these adjustments to your code. I really appreciate it. I'll give it a go right now and report back later.

Many thanks again.

CS

from excel-parser-processor.

btargac avatar btargac commented on June 22, 2024

By the way the new code is not usable right now, there will be a new release and in the update notes we will have this kind of story for extension free file urls.

Kind regards

from excel-parser-processor.

btargac avatar btargac commented on June 22, 2024

updates are handle in the pull request #54 and merged to master 👍🏼

from excel-parser-processor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.