Git Product home page Git Product logo

Comments (9)

dijs avatar dijs commented on August 17, 2024 1

Fixed in v4.0.0

from wiki.

dijs avatar dijs commented on August 17, 2024

Thanks for the reproducible error case. I will try to get to this fix soon.

from wiki.

dijs avatar dijs commented on August 17, 2024

I wonder if FC København.svg being different than FC_K%C3%B8benhavn.svg is the issue. If you want, you can try changing the conditional of byNamedImage to use URL encoding for equality.

from wiki.

kper avatar kper commented on August 17, 2024

I think the problem is when the lib tries to find the main image. For debugging purposes, I added some console.log to your byNamedImage function and found this mismatch (see the last two lines of the output) between name and searchName.

Modified Code:

const byNamedImage = searchName => image => {
	const [, name] = image.title.split(':');
	console.log(image);
	console.log("Name: " + name);
	console.log("searchName: " + searchName);

	return name === searchName;
};

Output:

{ pageid: 28199557,
  ns: 6,
  title: 'File:FC København.svg',
  imagerepository: 'local',
  imageinfo: 
   [ { url: 'https://upload.wikimedia.org/wikipedia/en/9/93/FC_K%C3%B8benhavn.svg',
       descriptionurl: 'https://en.wikipedia.org/wiki/File:FC_K%C3%B8benhavn.svg',
       descriptionshorturl: 'https://en.wikipedia.org/w/index.php?curid=28199557' } ] }
Name: FC København.svg
searchName: frameless|Logo
...

PS:

I didn't try the URL encoding yet

from wiki.

dijs avatar dijs commented on August 17, 2024

Good debugging. Yep sure enough... The main image is being parsed wrong.

[[File:FC København.svg|frameless|Logo]] is parsed as frameless|Logo instead of File:FC København.svg

from wiki.

hzitoun avatar hzitoun commented on August 17, 2024

Still having the same problem if with version 4.3.1.
(node:2016) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read prop erty 'imageinfo' of undefined

from wiki.

dijs avatar dijs commented on August 17, 2024

Can you please provide more information, a code example please?

from wiki.

hzitoun avatar hzitoun commented on August 17, 2024

@dijs yes I've created a new issue #62.

from wiki.

dijs avatar dijs commented on August 17, 2024

Thanks, fixed.

from wiki.

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.