The idea is to sort Images in views from lowest to the highest quality (not only size).


Image A = 640x480 100ko (blurred darkened)

Image B = 480x320 50ko (detailed)


1 - Image B

2 - Image A

  • Quality as in file size? – No Sssweat Jan 1 '16 at 11:22
  • Edited post to make it more clear. – khoy Jan 1 '16 at 11:43
  • I don't think there is anything that could auto detect if an image is blurred or not. – No Sssweat Jan 1 '16 at 11:47
  • Unless you add a field or perhaps in the image name or something that you could use as sign that tells you if it's blurred or not. – No Sssweat Jan 1 '16 at 11:51

The only way that I see is calculate image quality when it's saving and use it later. How to do it:

  1. Extend your file entity via module File entity
  2. Add special field to store value for image quality.
  3. Save value of quality into this field each time when file is saving. For example via hook_entity_presave
  4. Sort by this field in your views

How to calculate image quality? Here is good example but you can use your own approach to do it.

P.S. Yes it looks a little tricky but I don't think that it's possible to do it easier. But if it's possible I'll be happy to hear it.

  • Not easy but at least this will make it. Thanks a lot. – khoy Jan 1 '16 at 14:11

The easiest, but most time consuming, would be to create tags via taxonomy.

  1. Create a taxonomy reference field on your image entity using the File entity module
  2. Create taxonomies that contain the standardized image quality tags you would like to be able to sort by ex. blurred, darkened, detailed, etc
  3. When uploading the file, tag it with the selected taxonomy
  4. To simplify the tagging process use the Chosen module for selection.

Views supports taxonomy filtering and sorting really well. The reason this is a lot of work is it will require manual tagging.

  • Don't get how you could have this with taxonomy... – khoy Jan 1 '16 at 16:40
  • @khoy you need to use the File Entity module – No Sssweat Jan 24 '16 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.