121 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ---
  2. title: Plugin "SensitiveContent" messes up proportion in attachments
  3. author: notabug.org/aab
  4. time: Sat, 04 Apr 2020 21:03:08 UTC
  5. status: closed
  6. ---
  7. author: notabug.org
  8. time: Sat, 04 Apr 2020 21:03:08 UTC
  9. content: -----
  10. I had it activated since... i don't remember. Attachments in the two nodes i administer were showing with no proportion; through setconfig.php i managed to show them *a bit* better. Disabling the plugin brings everything back to normal.
  11. -----
  12. author: notabug.org
  13. time: Mon, 06 Apr 2020 16:21:19 UTC
  14. content: -----
  15. Wait, all attachments were affected by this plugin?
  16. -----
  17. author: notabug.org
  18. time: Mon, 06 Apr 2020 16:46:53 UTC
  19. content: -----
  20. Yes, both nodes showed that behaviour on all attachments.
  21. -----
  22. author: notabug.org
  23. time: Mon, 06 Apr 2020 16:55:13 UTC
  24. content: -----
  25. @aab my latest commit should fix this issue, but I don't really have a way to test it
  26. -----
  27. author: notabug.org
  28. time: Mon, 06 Apr 2020 17:04:04 UTC
  29. content: -----
  30. I've just tried on one of the nodes; as soon as the plugin is activated, proportion is gone.
  31. -----
  32. author: notabug.org
  33. time: Mon, 06 Apr 2020 17:23:20 UTC
  34. content: -----
  35. What do you mean by proportion? I might be misunderstanding you
  36. -----
  37. author: notabug.org
  38. time: Mon, 06 Apr 2020 17:39:54 UTC
  39. content: -----
  40. Ok, i'll try to explain better with images. Now, the one without is specially distorted, as i I had to change width and height thumbnails with setconfig in order to "fix" it: most of thumbnails fit in 600x90, as they are links, and not images like this. (Edit)Ah, and it doesn't depend on the theme used.
  41. -----
  42. author: notabug.org
  43. time: Tue, 07 Apr 2020 02:35:27 UTC
  44. content: -----
  45. Fixed with https://notabug.org/diogo/gnu-social/commit/9b587ae4a3f9e2e6f9ec2f496f631d7aaf045417 as seen in https://social.hackersatporto.com/conversation/5622#notice-11624
  46. -----
  47. author: notabug.org
  48. time: Tue, 07 Apr 2020 09:44:45 UTC
  49. content: -----
  50. Ok, sorry to reopen this, just a couple of things: - In the new README, this is the example: <code> addPlugin('SensitiveContent', ['hideforvisitors' => true] </code> But it does not work unless i write <code> addPlugin('SensitiveContent', ['hideforvisitors' => true]); </code> - Appart from that, i keep having distorted images with the plugin. I know it has been fixed, and i know why they keep being distorted: before i knew this plugin was responsible, i used setconfig.php to give thumbnails a fixed measure of 600x90. I've tried restoring them to the default value, 450x600: https://khp.ignorelist.com/conversation/206812#notice-426573 Is there any way to set this to "auto" (or something like that), so the thumbnails get the proportion they need?
  51. -----
  52. author: notabug.org
  53. time: Tue, 07 Apr 2020 12:56:13 UTC
  54. content: -----
  55. Fixed the README. run `./scripts/clean_thumbnails.php` Relevant settings concerning thumbs: https://notabug.org/diogo/gnu-social/src/nightly/lib/util/default.php#L285-L289 - `crop`: Crop to the given dimensions (not preserving aspect ratio) - `maxsize`: width and height won't be larger than this value (just re-read the code and, I don't think this setting was needed at all, it would be more helpful if it was an actual max size for a thumb file or smth...) - `width`: Max width - `height`: Max height - `upscale`: Whether to allow a thumb to acquire greater dimensions than its original file or not
  56. -----
  57. author: notabug.org
  58. time: Tue, 07 Apr 2020 13:25:37 UTC
  59. content: -----
  60. It seems i got it just like the default values: ```` thumbnail dir '/var/www/html/file/thumb' thumbnail path NULL thumbnail server NULL thumbnail crop 'false' thumbnail maxsize 1000 thumbnail width '450' thumbnail height '600' thumbnail upscale 'false' thumbnail animated 'false' ```` The only difference i can see is that "dir" is defined. I've executed clean_thumbnails, but there has been no change. Just in case, i've looked in db, everything seems fine... ````sh MariaDB [gnusocial]> select * from config where section = 'thumbnail'; +-----------+----------+-------+ | section | setting | value | +-----------+----------+-------+ | thumbnail | animated | false | | thumbnail | crop | false | | thumbnail | height | 600 | | thumbnail | upscale | false | | thumbnail | width | 450 | +-----------+----------+-------+ ````
  61. -----
  62. author: notabug.org
  63. time: Fri, 10 Jul 2020 08:13:36 UTC
  64. content: -----
  65. I've checked the plugin today after all this time, i'm afraid there's still disproportion in images: https://gnusocial.net/conversation/4963984#notice-8172421 setconfig.php -a | grep thumbnail gives ```` thumbnail dir '/var/www/gnusocial/file/thumb' thumbnail path NULL thumbnail server NULL thumbnail crop 'false' thumbnail maxsize 1000 thumbnail width 450 thumbnail height '600' thumbnail upscale 'false' thumbnail animated 'false' thumbnail file_quota '2097152' thumbnail process_links 'true' thumbnail show_thumbs 'true' ```` ```` MariaDB [gnusocial]> select * from config where section = 'thumbnail'; +-----------+---------------+---------+ | section | setting | value | +-----------+---------------+---------+ | thumbnail | animated | false | | thumbnail | crop | false | | thumbnail | file_quota | 2097152 | | thumbnail | height | 600 | | thumbnail | process_links | true | | thumbnail | show_thumbs | true | | thumbnail | upscale | false | +-----------+---------------+---------+ ```` I've also run clean_thumbnails. Anything else i'm missing?
  66. -----