Skip to content

Conversation

@kulmann
Copy link
Contributor

@kulmann kulmann commented Jul 31, 2025

Description

Introduced an alias for the thumbnailer max dimensions, because setting max height and max width separately makes no sense at all. Photos in portrait and landscape orientation exist. Makes no sense to have a different max height than max width.
Also adjusted the default value, because 7680px is not enough for a 50MP photo.

Motivation and Context

  • easier config
  • better defaults.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

@kulmann
Copy link
Contributor Author

kulmann commented Jul 31, 2025

@dragonchaser any comments about the var naming? "dimension" sounds like you wouldn't provide a number but a complete resolution as string (e.g. 9000x9000). But I don't have a better var name...

@kulmann kulmann requested a review from AlexAndBear July 31, 2025 07:47
@kulmann
Copy link
Contributor Author

kulmann commented Jul 31, 2025

@dragonchaser I'd say it even makes sense to deprecate the max width and max height var names... but no idea how to do that. Do you agree? And if yes, could you help me with it?

Makes sense I write a proposal.

@dragonchaser
Copy link
Contributor

@dragonchaser any comments about the var naming? "dimension" sounds like you wouldn't provide a number but a complete resolution as string (e.g. 9000x9000). But I don't have a better var name...

Yes right, but I have no alternative proposal.

DataEndpoint string `yaml:"data_endpoint" env:"THUMBNAILS_DATA_ENDPOINT" desc:"The HTTP endpoint where the actual thumbnail file can be downloaded." introductionVersion:"1.0.0"`
MaxInputWidth int `yaml:"max_input_width" env:"THUMBNAILS_MAX_INPUT_WIDTH" desc:"The maximum width of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputHeight int `yaml:"max_input_height" env:"THUMBNAILS_MAX_INPUT_HEIGHT" desc:"The maximum height of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputWidth int `yaml:"max_input_width" env:"THUMBNAILS_MAX_INPUT_WIDTH;THUMBNAILS_MAX_INPUT_DIMENSION" desc:"The maximum width of an input image which is being processed." introductionVersion:"1.0.0"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MaxInputWidth int `yaml:"max_input_width" env:"THUMBNAILS_MAX_INPUT_WIDTH;THUMBNAILS_MAX_INPUT_DIMENSION" desc:"The maximum width of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputWidth int `yaml:"max_input_width" env:"THUMBNAILS_MAX_INPUT_WIDTH" desc:"The maximum width of an input image which is being processed." introductionVersion:"1.0.0" deprecationVersion:"%%NEXT%%"`

MaxInputWidth int `yaml:"max_input_width" env:"THUMBNAILS_MAX_INPUT_WIDTH" desc:"The maximum width of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputHeight int `yaml:"max_input_height" env:"THUMBNAILS_MAX_INPUT_HEIGHT" desc:"The maximum height of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputWidth int `yaml:"max_input_width" env:"THUMBNAILS_MAX_INPUT_WIDTH;THUMBNAILS_MAX_INPUT_DIMENSION" desc:"The maximum width of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputHeight int `yaml:"max_input_height" env:"THUMBNAILS_MAX_INPUT_HEIGHT;THUMBNAILS_MAX_INPUT_DIMENSION" desc:"The maximum height of an input image which is being processed." introductionVersion:"1.0.0"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MaxInputHeight int `yaml:"max_input_height" env:"THUMBNAILS_MAX_INPUT_HEIGHT;THUMBNAILS_MAX_INPUT_DIMENSION" desc:"The maximum height of an input image which is being processed." introductionVersion:"1.0.0"`
MaxInputHeight int `yaml:"max_input_height" env:"THUMBNAILS_MAX_INPUT_HEIGHT" desc:"The maximum height of an input image which is being processed." introductionVersion:"1.0.0" deprecationVersion:"%%NEXT%%"`
MaxInputSideLength int `yaml:"max_input_side_length" env:"THUMBNAILS_MAX_INPUT_SIDE_LENGTH" desc:"The maximum side length of an input image which is being processed." introductionVersion:"%%NEXT%%"`

DataEndpoint: "http://127.0.0.1:9186/thumbnails/data",
MaxInputWidth: 7680,
MaxInputHeight: 7680,
MaxInputWidth: 10000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MaxInputWidth: 10000,

MaxInputWidth: 7680,
MaxInputHeight: 7680,
MaxInputWidth: 10000,
MaxInputHeight: 10000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MaxInputHeight: 10000,
MaxInputSideLength: 10000,

@dragonchaser
Copy link
Contributor

Unfortunately this needs more refactoring and rewriting of the values to the actual variables (I suggest if deprecated values are set to use the larger one).

@AlexAndBear
Copy link
Contributor

IHMO it would make more sense to have a env variable that limits the megapixel e.G maxInputMegaPixels and default to 50. By that we don't need to care about aspect ratio and so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants