Not sure if this is a bug....

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
kabads

Not sure if this is a bug....

Post by kabads »

It's not the linux mint distribution - that's working fine and well documented.

However, I'm trying to upload a 100x100px <100k .jpg image to the http://community.linuxmint.com site. When I upload the file with an extension of .JPG (uppercase) the site rejects the file. Changing the file extension means the file can be uploaded. Is this a usability bug?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Aging Technogeek

Re: Not sure if this is a bug....

Post by Aging Technogeek »

The extension ".JPG" is an invalid extension. Linux is case sensitive, so .JPG is not the same as .jpg.
kabads

Re: Not sure if this is a bug....

Post by kabads »

Aging Technogeek wrote:The extension ".JPG" is an invalid extension. Linux is case sensitive, so .JPG is not the same as .jpg.
What or who recognises uppercase file extensions as an invalid extension? I am aware that linux is case sensitive, but not that having uppercase as a file extension makes it invalid. For example, nautilus recognises files with uppercase extensions - and indeed linux allows files with uppercase extensions, so I'm not sure what you mean when you say it's an invalid file extension?
Aging Technogeek

Re: Not sure if this is a bug....

Post by Aging Technogeek »

What I mean is that .JPG and .jpg are not interchangeable. The proper file extension for a certain type of picture file is .jpg. The file system will not accept .JPG instead.

.JPG is a valid file extension, just not for the file type you are working with.
kabads

Re: Not sure if this is a bug....

Post by kabads »

I can accept that - thanks for clarifying. However, I'm not sure if everyone will see it as that - e.g. a newbie who is coming to linux. Some cameras (e.g. Canon) throw out files in .JPG format, which will need a rename before they are usable on the community site. Would it be better to accept .JPG as well? Even nautilus accepts and recognises these .JPG files, so they won't think to rename it as it appears like an image.
Aging Technogeek

Re: Not sure if this is a bug....

Post by Aging Technogeek »

I see what you are getting at now. It is really not something that can be readily addressed in Mint, or any Linux distro since it is a basic principle of the file handling protocol. Someone would need to write a script to change the extension automatically when the .JPG files are downloaded from the camera. And this would probably be of limited usefulness since it would be specific to one file extension. (I assume this would be the case. I am not a script writer so I cannot say for certain)

It is most likely easier to educate new users to the Linux file system so they know these things and can make the required changes as needed.
kabads

Re: Not sure if this is a bug....

Post by kabads »

Wouldn't it be easier to change the script that runs on the webserver so that it accepts the .JPG extension? That would be much simpler to do.
SimonTS

Re: Not sure if this is a bug....

Post by SimonTS »

Good idea...

...but then everybody would be expecting the webserver (and probably Linux in general) to accept .jpG .jPg .Jpg .JPg .JpG .jPG as well as the same combinations for every other file extension out there :shock:
kabads

Re: Not sure if this is a bug....

Post by kabads »

SimonTS wrote:Good idea...

...but then everybody would be expecting the webserver (and probably Linux in general) to accept .jpG .jPg .Jpg .JPg .JpG .jPG as well as the same combinations for every other file extension out there :shock:
That would be easily done with some regex work. What would be the problem of accepting all those combinations by the webserver? I can't think of any. I'm pretty sure that Linux doesn't give a stuff about any particular file extension for a .jpg file or for any other non-kernel related file for that matter - so I'm almost certain the kernel hackers don't give a fig about what file extensions are used for graphics.
kabads

Re: Not sure if this is a bug....

Post by kabads »

Kristian sums it up well in this bug reply:

https://bugs.launchpad.net/community.li ... bug/677636
bjd-pfq

Re: Not sure if this is a bug....

Post by bjd-pfq »

SimonTS wrote:Good idea...

...but then everybody would be expecting the webserver (and probably Linux in general) to accept .jpG .jPg .Jpg .JPg .JpG .jPG as well as the same combinations for every other file extension out there :shock:
You can hardly be sillier in your answer.
Parent poster already explained that some camera's throw out IMG1234.JPG files. Upper case that is.
My Pentax does that as well.

You are not telling me they aren't images just because you proclaim JPG to be an invalid extension. The latter is a neo-UNIX-newbie's typical pitfal.

If I want JPG's to be image files (for all I care they could be read right from the SD-card) and the 'system' doesn't provide for it, the system
has a shortcoming that needs to be fixed.
Typically under UNIX we make a fix a flexible one: allow the user --who came to UNIX for that power and to be treated as an informed conscious
adult that knows what she wants--, allow the user I repeat for instance to add a string to a plain text file listing extensions for images to be recognized.

What list?, where? -- that's something the person that broke this should know.

--
Locked

Return to “Beginner Questions”