Version 1.1.0 - June 1st, 2022
- Added Rich image embeds feature. Disabled by default.
- Changed Rich link previews now show the domain name of the destination website if the URL was a redirect instead of the domain name from the posted link.
- Changed Any link longer than 2048 characters is now automatically blacklisted and cannot be previewed.
- Fixed errors when inserting links longer than 255 characters.
- Fixed blacklist/whitelist not being applied to HTTP redirect destination.
- Fixed favicon not aligned properly with text.
- Fixed post preview now debounced to avoid many requests and crawls being performed if a URL is typed by hand.
- Fixed inline preview not switching to page title label when entering a link without ending slash.
This update also started collecting image Exif data, but this information is currently not displayed. It might be made visible in a future update.
You must run php flarum migrate
immediately after performing the update. Trying to create discussions or posts before the migrations have run will lead to errors.
The new image embed feature is still experimental, any suggestion is welcome!
The reason I added this feature was primarily because it solves the usually unavoidable issue of page content jumping during image loading. When an image has rich preview available, it not only shows that data when hovering the image with the mouse, but it actually also sets the width/height into the page DOM, and with this the image will take the correct space into the page even before it's fully loaded.
A future update will bring link and image embeds even closer by allowing preview of links that point to images and other content types.
I also want to show some of the image Exif data when available, but I'm not entirely sure how realistic or useful this will be. Most image hosting services will strip that data from images, and the images that still have the Exif data could actually contain compromising information that you'd prefer not be easily available (like showing the geolocation of the picture on a map directly in the meta overlay). If anyone has some feedback on where Exif could be useful, all suggestions are welcome!
This is how the image embed overlay looks like in the current 1.1 version. On mouseover the image darkens and the text/buttons appear: