A call to img.Image.Encode() can convert the image to another format.
For example, a WEBP image can turn into a PNG or JPEG, a GIF to a PNG
or GIF.
If the result needs to be open again with img.New(), we need its
content-type.
Resolves#955 root cause
When JSON-LD data exist, they get a top priority over any metadata.
We don't always want that.
- set json-ld metadata to a "ld" namespace in drop.Meta
- use most of these data as first choice when performing a meta lookup
- when looking for a date, fetch the first one that can be parsed, not
just rely on its presence
- the "ld.image" property (cover image) comes last in the lookup
Resolves#955Resolves#957
The youtube content script would use a property that doesn't exist
anymore (schema.identifier). It's present in the json-ld properties
so we can use it instead.
Resolves#954
Temporarily switches to a fork of htmlquery that pulls in the unreleased
version of `github.com/antchfx/xpath` that contains the `ancestor::` fix
https://github.com/antchfx/xpath/pull/119.
- GIFs are handled and fully decoded by a new `img.Image` implementation (`img.GIFImage`). It provides a resize method that resizes all frames in a GIF
- A single-frame GIF is always encoded to PNG (keeping the palette information)
- `img.GIFImage` implements `img.MultiFrameImage`, an interface that exposes `Frames() int` and `FirstFrame() Image`
- in internal.bookmarks, an `img.MultiFrameImage` with more than one frame is copied without conversion, regardless of its size
- in pkg.extract, `NewRemoteImage` will only keep the first frame. This is used only for thumbnails and icons; we don't want them to be animated
Resolves#945
Currently translated at 100.0% (142 of 142 strings)
Translated using Weblate (Polish)
Currently translated at 100.0% (142 of 142 strings)
Translated using Weblate (Polish)
Currently translated at 100.0% (142 of 142 strings)
Translated using Weblate (Polish)
Currently translated at 100.0% (142 of 142 strings)
Translated using Weblate (Polish)
Currently translated at 93.0% (495 of 532 strings)
Translated using Weblate (Polish)
Currently translated at 93.0% (495 of 532 strings)
Translated using Weblate (Polish)
Currently translated at 93.0% (495 of 532 strings)
Translated using Weblate (Polish)
Currently translated at 93.0% (495 of 532 strings)
Co-authored-by: Anonymous <anonymous@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: liilliil <liilliil@noreply.codeberg.org>
Co-authored-by: olivier <olivier@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/pl/
Translate-URL: https://translate.codeberg.org/projects/readeck/documentation/pl/
Translation: Readeck/Application
Translation: Readeck/Documentation
Currently translated at 91.5% (487 of 532 strings)
Translated using Weblate (Italian)
Currently translated at 91.5% (487 of 532 strings)
Translated using Weblate (Italian)
Currently translated at 91.5% (487 of 532 strings)
Translated using Weblate (Italian)
Currently translated at 90.4% (481 of 532 strings)
Translated using Weblate (Italian)
Currently translated at 90.4% (481 of 532 strings)
Translated using Weblate (Italian)
Currently translated at 90.4% (481 of 532 strings)
Translated using Weblate (Italian)
Currently translated at 90.4% (481 of 532 strings)
Co-authored-by: Anonymous <anonymous@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: gifilo <gifilo@noreply.codeberg.org>
Co-authored-by: liilliil <liilliil@noreply.codeberg.org>
Co-authored-by: olivier <olivier@noreply.codeberg.org>
Co-authored-by: Кнⷫѧⷷ̈зⷮьⷬ Кропоткинъ <kropotkin@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/readeck/application/it/
Translation: Readeck/Application
Exact strings come from quote values, with escape characters.
It is necessary to unquote the value otherwise it turns into something
that can't match a database query.
Example: "🧑🎓" becomes "🧑\u200d🎓"
Resolves#760
- Don't extract JSON-LD in ParseProps
- Extract microdata + JSON-LD in ParseMeta
- Add this cleaned-up version to the properties
- Retrieve information from the parsed data using glob patterns
The glob match works with "." as delimiters and let us retrieve
second level elements such as "*.headline".
It provides alternatives when needed, like "*.{image,image.url,thumbnailUrl}".
Property getter and iterator support multiple glob patterns where the
first pattern that yields results stops the iteration.
Glob patterns are cached so they don't have to be compiled each time
a page is retrieved.
No test was harmed in the process 🎉Resolves#864
This package's purpose is to provide:
- a microdata converter to JSON-LD
- a JSON-LD cleanup pass (badly formatted JSON and/or HTML escaped)
- a property lookup in the parsed data
This is by no means a full JSON-LD parser, expander, whatever. It makes
some naive and bold assumptions that received json-ld is always in
compact form, it doesn't care about context.
And it will be enough to query some metadata. This is not a good format
to work with.
- If the `<a>` element to be stripped has an "id" attribute, preserve that
attribute by moving it into the related heading element. This avoids breaking
Table of Contents functionality.
- When the contents of a self-linking `<a>` element is an `aria-hidden`d
element, assume that the contents doesn't need to be preserved. It is most
likely an icon or another kind of UI element.
- Skip over whitespace nodes when looking up next/previous element siblings.
- Enhance the log line by logging how many link elements were stripped.