Jump to content

markus_blue_tomato

Members
  • Posts

    192
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by markus_blue_tomato

  1. 4 hours ago, d'Hinnisdaël said:

    Very interesting! This is definitely the cleanest and most straight-forward option for generating low-quality image placeholders. Thanks for releasing ?

    Two questions  @Markus (Blue Tomato):

    1. How is performance for generating the data URIs? Do you generate them on the fly for every request or do you store the final LQIP data URI somewhere as well? My current implementation puts the tiny 200byte LQIP file alongside the source image; I wonder what's better here: generating in memory or reading from disk.

    2. I remember you releasing a similar tool for generating SVG shapes — did you stop using that in favor of the blurhash or are you using both in parallel?

    1. Currently the data URIs are not cached or saved somewhere. They are generated on the fly - I did not see huge performance issues yet - we use ProCache for caching the whole HTML.

    2. Yes we used "SVG Primitives". But the setup for this was too much work to maintain. Primitive itself was only written in Golang and the generation of the images took a huge amount of server resources.

  2. 10 hours ago, androbey said:

    Hi @Markus (Blue Tomato),

    thank you for the update. 

    I tested the new version and the generation and storage of the blurhashs works fine! On a side node, I find it still strange that the custom SQL did not (always) work.
    After upgrading my issue with "undefinded offset" was still present. I checked the used PHP Blurhash library and your code and I adjusted lines 108 and 109 and replaced $height and $width with $calcHeight and $calcWidth.

    This solves the issue (no more notices), but I don't know if it has any drawbacks..

    There was one problem, that the Hook was sometimes executed before the entry was saved to the database. So the blurhash query did not found the entry. And the second problem was an encoding issue with some characters int he blurhash.

    Strange... this undefinded offset did never happen in my side. But I will check if $calcHeight and $calcWidth works on my side and will change this in the repo

    • Like 1
  3. 8 hours ago, androbey said:

    Hi @Markus (Blue Tomato)

    I also think this is awesome!

    I wanted to try it, but I have some strange problems getting in running. I don't know if it is only me, but nevertheless I wanted to post here. Maybe someone can help. 

    One strange issue at first: 
    When an image is saved, the hash is not stored in the db table (although the "insertBlurhash" function returns true).

    And the second issue comes when calling the "getBlurhashDataUri" function. (I manually inserted the hash string to the database, because of the before mentioned issue). 
    Then I'll get based on the image up to several 100-thousands warnings like "PHP Notice: Undefined offset: 208 in .../ImageBlurhash/ImageBlurhash.module.php:122".

    Maybe there is some config issue on my side or anything else I missed. But maybe someone has an idea. 

    Btw. I checked it both on Windows and Linux with PHP 7.2 and latest ProcessWire dev version.

    Hi @androbey,

    Hm, sounds strange. What does the createBlurhash return before insertBlurhash is executed?

    I think the second issue depends on the first issue. Something is wrong with the creation of the blurhash - I guess it makes an corrupt image. Do you have an example image for me? Maybe I could reproduce it on my system.

    FYI: currently in runs on our production server with php 7.4, mysql 5.7 and latest processwire dev version on an debian buster machine

  4. Hi,

    I am working on a module which uploads my images to Adobe Scene7 (some kind of image hosting service...).

    Is there some method to change the path from the filename via API?

    $file->rename("/my/path/to/file.jpg"); only changes the basename of the file and does not save the path in the database.

     

  5. We have created a module to create BlurHash strings for images while uploading in ProcessWire. This blurry images will be saved in the database because they are very small (20-30 characters) and can be used for Data-URL's  as placeholders for image-lazy loading.

    https://github.com/blue-tomato/ImageBlurhash

    E.g. where we use this in production:

    • Like 19
    • Thanks 4
  6. I found now the real issue. It's not the commit above - I don't know why it worked yesterday while testing all the commits.

    Yesterday I imported also a new db dump copy from the production server into dev. I make this sometimes.
    After importing an older dump into dev it worked again. Something in the new dump makes my dev system running into timeouts...

  7. Hi folks,

    I have a really strange problem and don't know how to solve it or how to find the exact problem.

    Since this commit: https://github.com/processwire/processwire/commit/ca8e779402c4911aac2a0ad884cb2ee23f30dd62 my local dev setup based on Docker with PHP 7.4.5 and MySQL 5.7.29 are really slow. It happens on nearly 99% of the request in the Frontend and also on the Admin Panel. The are so slow, that the page runs into timeout after 5 minutes (my local php timeouts are high ? )

    But on my stage/production server which is nearly the same setup, database and code works fine.

    How can I find out what is happening?

  8. We had the need, that the URL of some pages should only be some kind of ID. I know that there are Modules like https://modules.processwire.com/modules/process-redirect-ids/, but since we have a kind of ProCache based Static Page Generator this modules doesn't work for us.

    So we created this module, which hides the name filed on pages with specific templates and which replaces the $page->name with the $page->id.

    https://github.com/blue-tomato/PageUseIdAsName

    • Like 2
  9. On 3/22/2020 at 2:16 PM, dragan said:

    As if Corona wasn't enough, this morning Zagreb was hit by an earthquake. It seems that several hospitals were also damaged. Now instead of staying at home, several people are forced to go outside.

    I felt it in the morning about 150 km away from ZG ... it was creepy

  10. Ah - after describing the problem I found the solution quick

    I'll check if there is a template with "field-" and current image field name.

    $customImageFieldTemplate = wire('templates')->get("field-$fieldName");

    After this I can iterate over $customImageFieldTemplate->fields

    • Like 1
  11. How can I get from an image field all custom image fields dynamically?

    E.g. $page->image->alt and $page->image->credits but how can I get this fields like $page->image->getCustomImagesFields or $page->image->getCustomImagesFieldsTemplate (where I can use the $template API methods $template->fields... 

     

  12. On 3/13/2020 at 11:53 AM, pwired said:

    covid kills 1% panic will kill the rest

    Below 1% with a functional health system. In italy the health system collapsed and the death rate there is about 3-5%

    • Like 1
    • Confused 1
  13. Starting tomorrow everybody in austria should be in self isolation:

    image.thumb.png.9a83b8c4a1600faba83ee0ce63654da4.png

     

    This is good but TESTING is still TO LESS. In Austria you get only testet if you have symptoms and had contact to someone how as testet covid-19.

    Really, my daughter and her mother had fever and has very strong cough. But no contact - no test. It's really stupid.

    • Sad 1
×
×
  • Create New...