mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 00:54:21 +01:00
img: include jpeg when detecting images
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -122,6 +122,10 @@ pub fn render_note_preview(
|
|||||||
.inner
|
.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_image_link(url: &str) -> bool {
|
||||||
|
url.ends_with("png") || url.ends_with("jpg") || url.ends_with("jpeg")
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn render_note_contents(
|
fn render_note_contents(
|
||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
@@ -184,7 +188,7 @@ fn render_note_contents(
|
|||||||
|
|
||||||
BlockType::Url => {
|
BlockType::Url => {
|
||||||
let lower_url = block.as_str().to_lowercase();
|
let lower_url = block.as_str().to_lowercase();
|
||||||
if !hide_media && (lower_url.ends_with("png") || lower_url.ends_with("jpg")) {
|
if !hide_media && is_image_link(&lower_url) {
|
||||||
images.push(block.as_str().to_string());
|
images.push(block.as_str().to_string());
|
||||||
} else {
|
} else {
|
||||||
#[cfg(feature = "profiling")]
|
#[cfg(feature = "profiling")]
|
||||||
|
|||||||
Reference in New Issue
Block a user