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

Image size option #22

Open
didikunz opened this issue Oct 19, 2023 · 4 comments
Open

Image size option #22

didikunz opened this issue Oct 19, 2023 · 4 comments

Comments

@didikunz
Copy link

didikunz commented Oct 19, 2023

"HomeLogo": {
	"description": "",
	"type": "string",
	"gddType": "file-path/image-path",
	"gddOptions": {
		"extensions": [
			"jpg",
			"png"
		],
		"size": {
			"width": 500,
			"height": 500
		}
	}
}

I would suggest adding a "size" block to the image definitions, so that a client could scale the image to the size demanded, to optimize templates performance. - By the way Blueprint already support this :)

@nytamin
Copy link
Member

nytamin commented Oct 20, 2023

I like the idea of defining size requirement, however I'd like to propose that we use the same definitions that are used to define getUserMedia (ie webcam input) resolutions, like so:

// (Note: All properties below are optional)
size: {
  width: {
    min: 1024,
    ideal: 1280,
    max: 1920,
    // exact: 1280 // when used, `exact` equals to `min` === `max`
  },
  height: {
    min: 576,
    ideal: 720,
    max: 1080,
    // exact: 720 // when used, `exact` equals to `min` === `max`
  },
}

This way, the template can define both ranges of supported resolutions (using the min/max/ideal) or exact resolutions (using exact).

Would that work for your use case as well, @didikunz ?

@didikunz
Copy link
Author

Sure, that works for me too.

My question here is, how to determine the min and max values, because one would need to test it on an individual basis. Or is there a (empiric) rule how much an image can be scaled down, until the template starts to stutter? The min value is easier as it can not be much lower that 80 to 90% of the ideal size. Any ideas?

@nytamin
Copy link
Member

nytamin commented Oct 23, 2023

I think that the size requirements will have to be determined on a per-template basis, since the performance of the template is highly dependent on the specific implementation of the template.

@didikunz
Copy link
Author

Make sense. For my generator app I will use some kind of defaults, or maybe add some settings later. So no reason to not proceed with this specification.

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

2 participants