Giter Site home page Giter Site logo

Comments (4)

ifl0w avatar ifl0w commented on July 17, 2024 1

Thank you for the input!

from randomwallpapergnome3.

weiss-d avatar weiss-d commented on July 17, 2024 1

Hi everyone!
After using this extension with Reddit for three days I can confirm that this is really an issue. Every third or fourth image has portrait orientation and therefore looks very blurry when sized to 1920x1080 screen 😿

from randomwallpapergnome3.

attilakillin avatar attilakillin commented on July 17, 2024

Hi!
I'm not very familiar with how Gnome Extensions work, so I don't know how to create a visual setting for this in the GUI, but adding extra conditions to this filter expression here in the sourceAdapter.js file is pretty straightforward and seems to do the trick:

const submissions = JSON.parse(message.response_body.data).data.children.filter(child => {
	if (child.data.post_hint !== 'image') return false;
	if (require_sfw) return child.data.over_18 === false;
	if (child.data.preview.images[0].source.width < 1920) return false;
	if (child.data.preview.images[0].source.height < 1080) return false;
	if (child.data.preview.images[0].source.height >= child.data.preview.images[0].source.width) return false;
	return true;
});

The child.data.preview.images[0].source object has a width and height variable, you can use them to specify arbitrary constraints.

Perhaps the best way to implement this would be to allow the user to specify constraints themselves? E.g. width > 1920, width > 2 * height. Or if it's too complicated to parse, maybe three options, a minimum width, a minimum height, and a range of allowed aspect ratios?

Edit: Hmm it doesn't seem to work after a day of usage. I'm probably missing something...

from randomwallpapergnome3.

ifl0w avatar ifl0w commented on July 17, 2024

@attilakillin Thanks for the research and sorry for the late response! Unfortunately, the most time-consuming part for me is to fiddle around with the UI as well. Also, I'd guess that you should not use the "preview" image in the response. I'd guess it is a smaller version than the actual image for displaying in the browser?

from randomwallpapergnome3.

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.