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

Fix issue when generating video thumbnails from network shares #3265

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

endoedgar
Copy link
Contributor

I've found that Nemo wasn´t generating video thumbnails whenever I was in a network share (I was using the default ffmpegthumbnailer). I was finding it weird because image thumbnails were fine.

Digging into the code I've found that we are passing the smb:// file uri to the gnome_desktop_thumbnail_factory_generate_thumbnail cinnamon-desktop function, and that in turn is calling g_filename_to_uri whenever it finds a %i in a thumbnailer.

That was exactly the case with ffmpegthumbnailer. Image thumbnailers normally don't use the %i format, but %u instead.

Since g_filename_to_uri doesn´t support anything else than local file:// uri, I've added this code to take care of that and fix the thumbnail generation.

@endoedgar
Copy link
Contributor Author

This will probably fix this reported issue #2979

@endoedgar endoedgar changed the title Fix issue when generating thumbnails from network shares Fix issue when generating video thumbnails from network shares Jul 9, 2023
GError *err = NULL;
char *local_filepath = g_file_get_path(file);

image_uri = g_filename_to_uri(local_filepath, NULL, &err);
Copy link
Member

Choose a reason for hiding this comment

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

You could use g_file_peek_path() here and save having to set and free local_filepath


if(err) {
DEBUG("(Thumbnail Thread) Failed to convert local_filepath to uri: %s", err->message);
g_free(err);
Copy link
Member

Choose a reason for hiding this comment

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

Use g_error_free()

@mtwebster mtwebster added the Blocked Needs rebase, changes, or discussion label Jul 20, 2023
@mtwebster mtwebster merged commit c389c2f into linuxmint:master Aug 9, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Needs rebase, changes, or discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants