Experiencing a 401 Unauthorized Error During Update?
If you're seeing a 401 Unauthorized error when trying to update your Joomla extension, it's likely due to our new two-factor authentication (2FA) security measure for your Download ID.
To resolve this, check your email (Spam folder?) for a message to approve your server or device, or read our detailed blog post here(
onlinecommunityhub.nl/best-practice/new-...-extension-downloads) to understand the steps involved. This will guide you through approving your server for future updates.
Implemented Rare Cases of Generated Images with Zero Bytes length
- Markus Bruhn
- Topic Author
- Offline
Less
More
- Posts: 6
- Thank you received: 0
2 years 4 months ago - 2 years 4 months ago #2052
by Markus Bruhn
Rare Cases of Generated Images with Zero Bytes length was created by Markus Bruhn
Hi Ruud,
I use your pugin with Joomla 3.10 and my Website has a lot of Traffic and a huge amount of images in total (>10.000).
When I enabled the Plugin for the first time (including webp conversion), some pages ran in timeouts and returned only a blank site. After limiting the cache Images creation to only one picture per request I did not experinced furthor timeouts.
But I found some pages where the image is missing. The img Tag is set including the srcset looks fine. One image link (for the largest one) in the srcset is defect, the image is found but it is an empty ressource. In the imagecache folder, I found some images with an filesize of zero. After deleting these images, they where regenerated and show correctly in the page.
From time to time I found new images with an filesize of zero in the image cache folder. I am worry that some users might see these images as blank image too.
My guess is that in case of timeouts or other temporary exceptions there is a chance that the cached image is generated with zero bytes file size. It would be great, when those corrupt images are not delivered to clients over and over. I have two ideas to do so:
1) check not only the exist of the file but also if the filesize is greather zero
2) generate the image with temporary filename (eg. with postfix) and rename the file to the final file. The file would only be renamed if no exception occours.
Regards
Markus
DOWNLOADLINK to test version
I use your pugin with Joomla 3.10 and my Website has a lot of Traffic and a huge amount of images in total (>10.000).
When I enabled the Plugin for the first time (including webp conversion), some pages ran in timeouts and returned only a blank site. After limiting the cache Images creation to only one picture per request I did not experinced furthor timeouts.
But I found some pages where the image is missing. The img Tag is set including the srcset looks fine. One image link (for the largest one) in the srcset is defect, the image is found but it is an empty ressource. In the imagecache folder, I found some images with an filesize of zero. After deleting these images, they where regenerated and show correctly in the page.
From time to time I found new images with an filesize of zero in the image cache folder. I am worry that some users might see these images as blank image too.
My guess is that in case of timeouts or other temporary exceptions there is a chance that the cached image is generated with zero bytes file size. It would be great, when those corrupt images are not delivered to clients over and over. I have two ideas to do so:
1) check not only the exist of the file but also if the filesize is greather zero
2) generate the image with temporary filename (eg. with postfix) and rename the file to the final file. The file would only be renamed if no exception occours.
Regards
Markus
DOWNLOADLINK to test version
This message contains confidential information
Last edit: 2 years 4 months ago by Ruud van Lent. Reason: added link to test version
The topic has been locked.
- Ruud van Lent
- Offline
Less
More
- Posts: 1640
- Thank you received: 107
2 years 4 months ago #2053
by Ruud van Lent
Replied by Ruud van Lent on topic Rare Cases of Generated Images with Zero Bytes length
Hi Markus, currently on holidays so short reply
Both your suggestions make sense! I will look into this and see what is best without generating extra overhead for each visitor
Both your suggestions make sense! I will look into this and see what is best without generating extra overhead for each visitor
The topic has been locked.
- Ruud van Lent
- Offline
Less
More
- Posts: 1640
- Thank you received: 107
2 years 4 months ago #2059
by Ruud van Lent
Replied by Ruud van Lent on topic Rare Cases of Generated Images with Zero Bytes length
Hi Markus,
I have implemented the filesize check.
So now when one or more of the images in a fileset have filesize 0, they will be regerated on next visit of the page. When 0, the srcset will not be implemented, it wil then use the element unaltered (and thus always showing the image).
Test version (I have this version currently on this site), is available in the first post (yours) of this topic.
Let me know if this works for you.
thanks for your patience
regards,
Ruud.
I have implemented the filesize check.
So now when one or more of the images in a fileset have filesize 0, they will be regerated on next visit of the page. When 0, the srcset will not be implemented, it wil then use the element unaltered (and thus always showing the image).
Test version (I have this version currently on this site), is available in the first post (yours) of this topic.
Let me know if this works for you.
thanks for your patience
regards,
Ruud.
The topic has been locked.
- Markus Bruhn
- Topic Author
- Offline
Less
More
- Posts: 6
- Thank you received: 0
2 years 4 months ago #2060
by Markus Bruhn
Replied by Markus Bruhn on topic Rare Cases of Generated Images with Zero Bytes length
Hi Ruud,
I had test your new version and it looks fine. I had created a second cache folder and intentionally use a slightly to hight image creation limit so the side has experinced sometimes a timeout. In the cachefolder a few images has a zero lenght but after a while they become a new size, so these . I also did not see any missing images on the site. Correct resized images won't be resized over and over.
Thanks for your fix!
Markus
I had test your new version and it looks fine. I had created a second cache folder and intentionally use a slightly to hight image creation limit so the side has experinced sometimes a timeout. In the cachefolder a few images has a zero lenght but after a while they become a new size, so these . I also did not see any missing images on the site. Correct resized images won't be resized over and over.
Thanks for your fix!
Markus
The topic has been locked.
- Ruud van Lent
- Offline
Less
More
- Posts: 1640
- Thank you received: 107
2 years 3 months ago #2065
by Ruud van Lent
Replied by Ruud van Lent on topic Rare Cases of Generated Images with Zero Bytes length
Hi Markus,
thanks for testing. Change will be in in next release.
regards,
Ruud.
thanks for testing. Change will be in in next release.
regards,
Ruud.
The topic has been locked.
- Ruud van Lent
- Offline
Less
More
- Posts: 1640
- Thank you received: 107
2 years 3 months ago #2071
by Ruud van Lent
Replied by Ruud van Lent on topic Rare Cases of Generated Images with Zero Bytes length
Just released version 1.16.0 with this change implemented
The topic has been locked.