*

katalin2k

  • ***
  • 65 posts
Suggestion for uploading images
« on: January 25, 2025, 09:02:23 PM »
When uploading images if you have more images uploaded directly from phone with over 1,5-2MB it takes a lot of time to generate all the thumbnails, sometimes over 10 seconds and this might lead to users cancelling and not adding the new listing. You should implement something new to generate thumbnails in background or when a user first visits the listing. This also applies to Ad Importer plugin, it takes a huge time to add 10 or more listings with import.

*

MB Themes

Re: Suggestion for uploading images
« Reply #1 on: January 26, 2025, 08:53:38 AM »
If I would be user, I would rather wait for 10sec so I can review my listing, then waiting few minutes for cron to pick it up.
Pretty sure that fancy loading message with what is going on would be more helpful.
For ad importer plugin, try to optimize images and do not send larger images then needed.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Suggestion for uploading images
« Reply #2 on: January 26, 2025, 08:55:59 AM »
What I found on google is that faster CPU make imagemagick faster as well.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

katalin2k

  • ***
  • 65 posts
Re: Suggestion for uploading images
« Reply #3 on: January 27, 2025, 08:51:23 PM »
If I would be user, I would rather wait for 10sec so I can review my listing, then waiting few minutes for cron to pick it up.
Pretty sure that fancy loading message with what is going on would be more helpful.
For ad importer plugin, try to optimize images and do not send larger images then needed.
You are probably right but you guys need to find a solution for this because I have other websites and I upload 10-20 images, even bigger in size, they make a lot more thumbnails and still load faster on exactly the same hosting.

*

MB Themes

Re: Suggestion for uploading images
« Reply #4 on: January 28, 2025, 09:57:43 PM »
@katalin2k
Then pay developer to do the same. No one "must" to do anything, it's open source script. Do it and share it.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

katalin2k

  • ***
  • 65 posts
Re: Suggestion for uploading images
« Reply #5 on: January 28, 2025, 11:53:22 PM »
I understand your point of view but isn’t the whole thing to make it as good as possible?

*

MB Themes

Re: Suggestion for uploading images
« Reply #6 on: Yesterday at 08:33:16 AM »
There are better things to do to be honest. Not everyone use ad importer, not many people those use it, load 20 images per item, and visitors those upload 20 pictures are probably OK to wait few seconds until it get processed.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Suggestion for uploading images
« Reply #7 on: Yesterday at 08:41:54 AM »
Try to play with compressor.
In oc-includes/osclass/frm/item.frm...


find this line:
Code: [Select]
}).use(Uppy.Compressor, {
I found it supports maxWidth and maxHeight, so if image is larger, it's going to convert to smaller dimension.
This can be handy if you upload image 8000x8000px, but on site you generate just 1024x768... you don't need that big one.

Change it to:
Code: [Select]
        }).use(Uppy.Compressor, {
          quality: 0.85,
          maxWidth: 1600,
          maxHeight: 1600
         

Carefully if you use "keep aspect ratio" as you might get portrait image... but if you use for maxWidth and height same value, you should be OK.
I tested it and it do compression on upload, so PHP already receive smaller image and might be faster.
This will not work for Importer as this one provides images to osclass diferently
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

katalin2k

  • ***
  • 65 posts
Re: Suggestion for uploading images
« Reply #8 on: Yesterday at 03:59:22 PM »
Try to play with compressor.
In oc-includes/osclass/frm/item.frm...


find this line:
Code: [Select]
}).use(Uppy.Compressor, {
I found it supports maxWidth and maxHeight, so if image is larger, it's going to convert to smaller dimension.
This can be handy if you upload image 8000x8000px, but on site you generate just 1024x768... you don't need that big one.

Change it to:
Code: [Select]
        }).use(Uppy.Compressor, {
          quality: 0.85,
          maxWidth: 1600,
          maxHeight: 1600
         

Carefully if you use "keep aspect ratio" as you might get portrait image... but if you use for maxWidth and height same value, you should be OK.
I tested it and it do compression on upload, so PHP already receive smaller image and might be faster.
This will not work for Importer as this one provides images to osclass diferently
I will try this. I uploaded 4 photos between 1,5 and 2MB with 4032x3024 and after I hit “Post” it loaded for 57 seconds! Huge time if you ask me! I will try what you suggested and let you know!