Search…

X3 Photo Gallery Support Forums

Search…
 
tianyi
Topic Author
Posts: 4
Joined: 24 Jul 2020, 22:39

need help!

24 Jul 2020, 23:47

My website: infd.cn
I found these bugs, not sure if it's only appearing on my website.
1.When fist time opening website and go into subdirectories, some of the photos in this gallery will stick together.

Image
2.In the function"popup", when i click "zoom", the browser normally loading original picture,but when loading complete, it did not refresh and the image still blurry.
Image
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12512
Joined: 30 Sep 2006, 03:37

Re: need help!

25 Jul 2020, 00:41

tianyi wrote:1.When fist time opening website and go into subdirectories, some of the photos in this gallery will stick together.
Hmm, yes. I did some tests, and can see that this happens when 1) Browser has physical scrollbar (Windows), and 2) you navigate from a page without scrollbar (for example home page) to a page with scrollbar (for example zc/ce/2016). I thought this was resolved, but maybe it's related to the new scrollbar designs. I will look into it later today and get back to you.
tianyi wrote:2.In the function"popup", when i click "zoom", the browser normally loading original picture,but when loading complete, it did not refresh and the image still blurry.
What is the link to this page and image please? I see you have extremely large file sizes 8MB, which I assume is related. Some browsers might not be able to handle the dimensions, but I need to check from here. I tested some of your other images, and they load fine into my browser, but they are massive. For example 5472px:
infd.cn/content/zc/ce/2017/IMG_0138.JPG

Images should be resized to web-friendly sizes, so that they don't take too long to load, and don't cause memory problems on small/old devices. I wrote a post:
https://www.photo.gallery/blog/image-si ... -websites/

I need a link to test specifically that image, but I assume it's related to size vs browser and device.
 
tianyi
Topic Author
Posts: 4
Joined: 24 Jul 2020, 22:39

Re: need help!

25 Jul 2020, 02:36

I've tried several times and i found that the first time i click "zoom", the photo is exactly enlarged and start loading the original one at the same time. When loading complete, the image don't refresh untill i close the popup and reopen it. Maby its my device's problem, cause some days ago i use another computer it works fine. On the current computer i use, the problem is not only appearing on a singal picture, each every one is the same situation. You said they loaded fine in your browser, then i think the problem may because of my old devices.
Thanks for your reply! Very glad to have this nice gallery product!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12512
Joined: 30 Sep 2006, 03:37

Re: need help!

25 Jul 2020, 02:57

tianyi wrote:I've tried several times and i found that the first time i click "zoom", the photo is exactly enlarged and start loading the original one at the same time. When loading complete, the image don't refresh untill i close the popup and reopen it.
I think it's related to the very large dimensions of your images. When very large images are loaded into browser, they will consume a lot of memory. For example, a 5000 x 4000 px image, will consume around 80MB of memory in the browser (5000 x 4000 x 4 channels). Considering the popup may hold 3-4 images at once, that would require 2-400 MB only for the popup. Some browsers on old devices and/or mobiles may have memory limitations.

I'll get back to you later in regards to the layout bug. I might have a temporary solution.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12512
Joined: 30 Sep 2006, 03:37

Re: need help!

25 Jul 2020, 05:38

tianyi wrote:1.When fist time opening website and go into subdirectories, some of the photos in this gallery will stick together.
Apparently, this bug happens only with 1) Sidebar layout, 2) Windows (scrollbars), and 3) When navigating from a page without scrollbars (for example your home page) to a justified-gallery page with scrollbars. I will look into a proper fix for this bug in next X3 release. In the meantime, I have two "hacks" for you:

1. Simple solution, is to set body overflow-y: scroll. This will cause the scrollbar area to always remain visible, also on the home page. Not elegant, but it prevents the bug when navigating to the gallery. Go to Settings > Custom > Custom CSS, add the following:
Code
body {
  overflow-y: scroll;
}
2. More complicated solution, is to force browser window resize event, after the gallery renders. This is not elegant either, because it causes a reflow of the gallery after it's loaded. But it does fix the layout. Go to Settings > Custom > Javascript, and add the following:
Code
var resize_observer = false;
function kill_resize_observer(){
  if(!resize_observer) return;
  resize_observer.disconnect();
  resize_observer = false;
}

function x3_load_page(){
  if('ResizeObserver' in window && typeof(Event) === 'function' && document.documentElement.classList.contains('root-scrollbar')){
    kill_resize_observer();
    var justified = document.getElementsByClassName('layout-justified');
    if(justified.length){
      var jwidth = justified[0].clientWidth;
      resize_observer = new ResizeObserver(function(){
        if(jwidth !== justified[0].clientWidth) window.dispatchEvent(new Event('resize'));
        kill_resize_observer();
      });
      resize_observer.observe(justified[0]);
    }
  }
}
I would probably recommend option 1.
 
tianyi
Topic Author
Posts: 4
Joined: 24 Jul 2020, 22:39

Re: need help!

25 Jul 2020, 08:31

I set the change and it works!
Thank you so much!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12512
Joined: 30 Sep 2006, 03:37

Re: need help!

04 Jan 2021, 04:55

mjau-mjau wrote:Apparently, this bug happens only with 1) Sidebar layout, 2) Windows (scrollbars), and 3) When navigating from a page without scrollbars (for example your home page) to a justified-gallery page with scrollbars.
I believe this should be resolved in X3.30.0 / forum
photo.gallery/blog/photo-gallery-x3-30-popup/
mjau-mjau wrote:1. Simple solution, is to set body overflow-y: scroll. This will cause the scrollbar area to always remain visible, also on the home page. Not elegant, but it prevents the bug when navigating to the gallery. Go to Settings > Custom > Custom CSS, add the following:
Code
body {
  overflow-y: scroll;
}
Perhaps after updating to X3.30.0, try to remove the fix above?