Photo files with extension name other than ".jpg", ".jpeg", ".gif", ".png", ".bmp" or without extension can not be added into wallpaper list

Bug #235382 reported by cathyli
2
Affects Status Importance Assigned to Milestone
Moblin Applets
Won't Fix
Medium
ToddBrandt

Bug Description

Description:
---------------
Photo files with extension name other than ".jpg", ".jpeg", ".gif", ".png", ".bmp" or without extension can not be added into wallpaper list, found the issue in applets 0.66-0ubuntu5.
Is a proper way to identify image file not only by extension name ".jpg", ".jpeg", ".gif", ".png", ".bmp" but also file header? I know this is not easy to realize.

Reproduced steps:
---------------
1. Put some photo files with extension name ".jpg", ".jpeg", ".gif", ".png", ".bmp" into /home/ume/media/photo/
2. Launch Desktop background from Preferences, all these files are added into wallpaper list.
3. Change extension name of photo files in step1 to other than ".jpg", ".jpeg", ".gif", ".png", ".bmp" or without extension, such as change 1.bmp to test or 1.txt
4. Launch Desktop background from Preferences to check if all these files be added into wallpaper list.

Current result:
---------------
In step4, the photo files cannot be added to wallpaper list.

Expected result:
---------------
In step4, the photo files should be added to wallpaper list because they are indeed image even though lose extension or have wrong extension name.

cathyli (cathy-li)
Changed in moblin-applets:
assignee: nobody → todd-e-brandt
importance: Undecided → Medium
Revision history for this message
ToddBrandt (todd-e-brandt) wrote :

Well, I wanted to keep the check simple because disk accesses can take a long time. My test platform has ~4000 images which is what I have to account for (I know many people with 1000 plus photos lying around, so I'm highballing the support scenerio to make sure that their user experience is good).

So right now, the first phase of the background load is to just read one or two directory's file tables and to create a list based on name. That means that even if there's 4000 images, the dialog is populated in well under a second.

If I do what you're suggesting, the initial load time before displaying the image name list will be anywhere from 1 to 5 seconds (depending on what power state ppm has the system in). That's because instead of reading in two tiny inodes, the applet now has to open 4000 file descriptors and pull in a kilobyte or so of data from each of the files. So that's the negative aspect of what you're proposing.

Also, since the background applet doesn't support the use of file searches or manual additions of directories, it's reasonable to assume that any directory that's tagged in gconf for the applet to traverse is going to be designated for image files only. So adding this check is likely going to be a redundant feature.

So the fact that it's likely redundant, combined with the fact that it will certainly add overhead, make me have to say no to this feature request. Interesting catch though.

Changed in moblin-applets:
status: New → Won't Fix
Revision history for this message
cathyli (cathy-li) wrote :

I also tried it on two linux PCs, PC_A is installed Ubuntu, and PC_B is installed Fedora, the behavior is different:
PC_A:
1. change one image file 1.jpg to test, still can be added into wallpaper list, work correctly.
2. change one image file 1.jpg to test.txt, cannot be added into wallpaper list, doesn't work.

PC_B:
1. change one image file 1.jpg to test, still can be added into wallpaper list, work correctly.
2. change one image file 1.jpg to test.txt, still can be added into wallpaper list, work correctly.

It's better if our MID device can work well as PC_B which is installed Fedora.
Anyways, it's a wishlist feature request which may spend more time loading image files especially when there are lots of photos. Close it currently.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.