Making WordPress.org

Opened 2 years ago

Closed 21 months ago

#6393 closed defect (bug) (invalid)

In photo directory, uploading .jpg photo but still showing error of not valid extension type.

Reported by: smit08's profile smit08 Owned by:
Milestone: Priority: normal
Component: Photo Directory Keywords: needs-patch has-screenshot reporter-feedback
Cc:

Description

I am trying to contribute to the photo directory and upload the photos clicked by me, all the photos are the jpg type extension but after submitting it still showing the error "This is not a supported image file. Please use a .jpg or .jpeg file.: IMG_20220524_225426_160.jpg".

Attaching image for better understanding.

Attachments (1)

Screenshot 2022-07-07 at 3.39.37 PM.png (423.9 KB) - added by smit08 2 years ago.

Download all attachments as: .zip

Change History (3)

#1 @dd32
2 years ago

  • Keywords reporter-feedback added

In addition to the filename, the mime type of the image is also checked.

Without the image (Can you attach it here?) it's hard to tell, but I'm guessing it's a PNG or other filetype saved as a .jpg.

If you're on a mac/linux system, you can use file to determine the type:
(This example is a .jpg from a mobile phone)

$ file --mime-type IMG20201121152449.jpg
IMG20201121152449.jpg: image/jpeg

$ file IMG20201121152449.jpg
IMG20201121152449.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=12, height=3000, manufacturer=OPPO, model=OPPO A52, orientation=upper-left, xresolution=158, yresolution=166, resolutionunit=2, datetime=2020:11:21 15:24:49, GPS-Data, width=4000TIFF image data, little-endian, direntries=12, height=3000, manufacturer=OPPO, model=OPPO A52, orientation=upper-left, xresolution=158, yresolution=166, resolutionunit=2, datetime=2020:11:21 15:24:49, GPS-Data, width=4000], baseline, precision 8, 4000x3000, components 3

and a PNG saved as a jpeg:

$ file TESTTRAC.jpg
TESTTRAC.jpg: PNG image data, 3456 x 2302, 8-bit/color RGBA, non-interlaced

#2 @coffee2code
21 months ago

  • Resolution set to invalid
  • Status changed from new to closed

As indicated, the image type is checked in a few places other than just for the file extension. If it reports that the image is not a supported image file, then the file does not look like a JPEG file. Without a copy of the original photo in question, as was requested, we can't provide any further insight into this particular case.

Note: See TracTickets for help on using tickets.