yes, the naming convention for resized images is name-{width}x{height}.extension.
Is it good enough info to base a regex on? in practice most likely yes, but in theory no. You just can’t know if mark-20×20.jpg was not simply uploaded that way, and even in places where you know that a resized image should be used you have no way to know if wordpress had decided that the best fitting image is the original.
The proper way to know what is the original image based on image url is to search the attachments part of the DB for it which can be a little PITA (no simple API for it as far as I know).
Related Posts:
- Image Upload from URL
- Upload images to remote server
- Limit image resolution on upload
- How to insert images into posts without using Add Media dialog
- Media Upload Folder – how to manage
- Upload multiple images in a custom metabox
- hook into completed image upload filter
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- getting uploaded SVG dimensions on front-end
- Adding upload button in metabox
- Automating a Daily Picture Blog?
- Images uploading to wrong folder
- Replace all of post’s image URLs with upload directory URLs
- Alter media caption/description conflict in WordPress?
- Restrict the number of images to upload per post
- WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
- Frontend image uploading from edit profile page. (goldenapples)
- Rename attachments during upload
- Filter to modify post_title after image upload?
- Automatically Add Caption in image
- Uploading images to Media Library fails with Memory Exhausted
- Edit image preview is not displayed
- How to add a media with PHP
- Rename image during upload using date and time stamp?
- How to disable the suffix “-scaled” which is being added at the end of each uploaded image?
- How to set a Minimum Image Dimension for Uploading
- What’s the best “insert all images” plugin?
- Different upload path per file type
- Animated Gif image not uploading correctly
- Frontend Post – Allow Only Image File Upload
- HTML tags in WordPress image caption
- How to order images in a post in WordPress 3.3?
- Is there a plugin or simple way to add a multiple images metabox to a post?
- How can I upload an image for background use using the Theme Editor in WordPress?
- Generating different dimension images while uploading image file from custom plugin page
- Change WordPress Media Manager
- Show media url immediately after upload in media uploader
- Multiple images with Media Uploader on front-end
- Can’t seem to attach uploaded image to post and set it as thumbnail
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- Image upload appearing as broken images following server move
- Migration to WP – Couldn’t load image
- How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product
- WordPress automatically downscaled images larger that original
- How to stop thumbnail generation from some images and different size thumbnail generate
- How do I fix “Sorry, this file type is not permitted for security reasons”
- an error occurred in the upload. please try again later (Maybe File Permission Issue)
- Auto delete attachments that are older than x days
- Show image crop window on image upload
- Change wp-content/uploads to uploads/%postname%/%image%
- Change media URL (images)
- Uploaded images not displaying in network site
- Does wp_get_attachment_image_src also work with non-image files?
- Change image name during uploading sequentially
- How to limit the number of images displayed in the media window?
- Upload media only to DB
- How to get the real file type for images that do not have an extension
- Get images attached to a specific page
- WordPress Creates Unused (Unregistered) Image Sizes
- Images don’t update after being edited
- Is there a way in WordPress to convert images to WebP without a plugin?
- Some Images Disappeared from Media Library?
- Disable image rename on upload
- HTTP error when uploading an image
- adding image to post thumbnail from another server
- How can i identify media uploaded to my website that is not being used anywhere anymore?
- Upload images – Theme options
- image URL changed in wordpress
- image upload/edit is broken: “Image data does not exist. Please re-upload the image.”
- WordPress append -1 to the image name
- Save media files (images) to database instead of the filesystem
- Recreate the upload folder from a website without having access to the backend/cpanel/filezilla directly from the website
- Trouble with Uploading and Displaying Images
- WordPress Multisite: Images moved to /sites/1?
- media_handle_upload() with 1 image under 1Mb chokes my server and returns timeout error
- Could creation of various image sizes cause slow form submission response?
- Updated wordpress missing image upload area
- How to disable post-thumbnail from generation?
- Change wordpress default upload path to another domain
- How to get attachements URL from author meta and display them?
- How to stop a post from publishing if the file upload is not a image/gif
- Troubles with code for upload a image
- WAMP install acts different than live install when uploading images
- What is the best way to handle Ajax image upload on front end?
- 403 Forbidden when accessing image in wordpress
- How can I hook and edit on the fly an image uploaded
- problem with updating metabox of upload image
- Assign one featured image to multiple posts?
- Missing Images in Uploads Directory (Server Only)
- Media upload in add comment meta box
- Transfered live site to new server and images are not showing
- Limit files uploaded per folder
- My image rotate 90 degree
- Bug when uploading pictures with Arabic name characters?
- wp_handle_upload Image sizes
- What type to upload image within theme options?
- Can’t manage to display an uploaded picture (uploaded from a custom button) in the front end
- My subdirectory sites images (except webP) are throwing to 404 page even they are exist
- Uncaught Error: Call to undefined function file_is_valid_image()
- Can’t upload svg files in WordPress