Skip to content

articlehandler::image_list needs cleaning logic for image names #9

@sm13

Description

@sm13

If this is to be used instead of the image_list_all() method, or in addition to, it will need to clean the suffix in 2 ways because images with names such as this aberration need fixing.

070f1ffa-b9a0-444e-9324-9ad79b6be766.png_auto_compress_format_format_webp

Two fixes are necessary:

  1. They must have a proper extension.
  2. They must begin with a letter, I chose 'p' for picture.

This was the original code:

            for img in item.get_image_refs() {
                let split_url = img.src.rsplit_once("/");

                if let Some((pre, suff)) = split_url {
                    println!("IMG: {:#?}", suff.clone());
                    img_list.insert(img.src.clone(), suff.to_string());
                }
            }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions