Skip to content

Commit

Permalink
support .jpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdallas committed Nov 28, 2022
1 parent 4393b88 commit 0fa7dd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::utils::{check_path_present, check_url_has_mime_type};

pub static JPG_EXTENSION: &str = "jpg";
pub static PNG_EXTENSION: &str = "png";
pub static JPEG_EXTENSION: &str = "jpeg";
pub const GIF_EXTENSION: &str = "gif";
pub const GIFV_EXTENSION: &str = "gifv";
const MP4_EXTENSION: &str = "mp4";
Expand Down
2 changes: 1 addition & 1 deletion src/structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl Post {
if url.contains(REDDIT_IMAGE_SUBDOMAIN) {
// if the URL uses the reddit image subdomain and if the extension is
// jpg, png or gif, then we can use the URL as is.
if url.ends_with(JPG_EXTENSION) || url.ends_with(PNG_EXTENSION) {
if url.ends_with(JPG_EXTENSION) || url.ends_with(PNG_EXTENSION) || url.ends_with(JPEG_EXTENSION) {
return MediaType::RedditImage;
} else if url.ends_with(GIF_EXTENSION) {
return MediaType::RedditGif;
Expand Down

0 comments on commit 0fa7dd4

Please sign in to comment.