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

feat: jsonrpc: add late_file_message_mediasize #6428

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Simon-Laux
Copy link
Contributor

No description provided.

@Simon-Laux Simon-Laux force-pushed the simon/jsonrpc-add-late_file_message_mediasize branch from 96e65f9 to ef8b98e Compare February 16, 2025 20:30
@Simon-Laux Simon-Laux requested a review from iequidoo February 16, 2025 20:32
@Simon-Laux Simon-Laux requested a review from link2xt February 22, 2025 03:38
// The new width and height to store in the message object. None if you don't want to change the dimensions.
pub wh: Option<(u32, u32)>,
// The new duration to store in the message object. None if you don't want to change it.
pub duration: Option<u32>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the unit for duration, seconds, milliseconds?

let duration = self
.duration
.unwrap_or(0)
.to_i32()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This converts everything to i32, but then function arguments are u32 everywhere.

Copy link
Collaborator

@iequidoo iequidoo Feb 22, 2025

Choose a reason for hiding this comment

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

u32 is the right type obviously, but Core's Message::latefiling_mediasize() takes i32 args, probably should be fixed there

/// Changes the message width, height or duration, and stores it into the database.
///
/// Sometimes, the core cannot find out the width, the height or the duration
/// of an image, an audio or a video.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would this happen that image dimensions are wrong? If UI can determine the the image size, can it just display the image correctly, why does it need to store it back into the database and read back?

@link2xt
Copy link
Collaborator

link2xt commented Feb 22, 2025

I don't understand the purpose of this PR. If the core is buggy and provides wrong dimensions, UI has to check and correct it, we can as well just drop the API to read these values and move the logic entirely in the UI instead of the UI telling the core what it should tell the UI.

@r10s
Copy link
Contributor

r10s commented Feb 22, 2025

the idea of the api was to speed up things on subsequent loads on android, eg UI can show placeholder in correct aspect ratio, leading to less flickering and jumping, esp if there are lots of images/videos

but that was 7 years ago, if desktop could live without the api up to now, there might be no need :)

for android, we can check that at some point, if it is still needed, i would not remove the api just now

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

Successfully merging this pull request may close these issues.

4 participants