Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i cannot user it #25

Open
yuf19-2022 opened this issue Dec 30, 2024 · 3 comments
Open

i cannot user it #25

yuf19-2022 opened this issue Dec 30, 2024 · 3 comments

Comments

@yuf19-2022
Copy link

i download the code and Put gallery.html in the folder that contains myphotos.when i directly open the gallery.html in File Explorer,it does not work well.and i start nginx,in this way it cannot work neither.

@GaiusVampus
Copy link

I assume you are using Windows where certain security settings will block access to the .html file trough the "file:" URL scheme, block the execution of scripts within the file or to the files next to it or to the folder itself.

You can find out on your own by inspecting the page and see if there are any errors. In my case something like

file:///C:/Users/name/Pictures/' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome-extension, chrome-untrusted, data, edge, http, https, isolated-app.

led me to the assumption above.

I am not an experienced Windows user but in order to help you I played around with some options passed to Edge/Chrome but still I would have to lower the security settings for the surrounding folder. I suggest that for your computers security you leave them as they are and use a local web server instead.

For simple manual browsing of local pictures use some other software (apps).

I used this library for years now (running macOS with Apache) to have these services in my local network available from other machines which works more than just quite well. Again, I thank the author for publishing this.

@yuf19-2022
Copy link
Author

I assume you are using Windows where certain security settings will block access to the .html file trough the "file:" URL scheme, block the execution of scripts within the file or to the files next to it or to the folder itself.

You can find out on your own by inspecting the page and see if there are any errors. In my case something like

file:///C:/Users/name/Pictures/' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome-extension, chrome-untrusted, data, edge, http, https, isolated-app.

led me to the assumption above.

I am not an experienced Windows user but in order to help you I played around with some options passed to Edge/Chrome but still I would have to lower the security settings for the surrounding folder. I suggest that for your computers security you leave them as they are and use a local web server instead.

For simple manual browsing of local pictures use some other software (apps).

I used this library for years now (running macOS with Apache) to have these services in my local network available from other machines which works more than just quite well. Again, I thank the author for publishing this.

hello,you are very right.when i
Open the html file in File explore, the err on the console is above you have said. Cors, files, https...so i use nginx ,start a port to access in my chrome browser with local network, but it still didn't work.

@yuf19-2022
Copy link
Author

我假设您正在使用 Windows,其中某些安全设置将阻止通过“文件:”URL 方案访问 .html 文件,阻止执行文件内或旁边的文件或文件夹本身的脚本。

你可以自己检查页面,看看是否有任何错误。我的情况是这样的

来自来源“null”的 file:///C:/Users/name/Pictures/' 已被 CORS 策略阻止:跨源请求仅支持以下协议方案:chrome-extension、chrome-untrusted、data、edge、http、https、isolated-app。

导致我得出上述假设。

我不是经验丰富的 Windows 用户,但为了帮助您,我尝试了一些传递给 Edge/Chrome 的选项,但我仍然必须降低周围文件夹的安全设置。为了您的计算机安全,我建议您保持原样,并使用本地 Web 服务器。

为了简单地手动浏览本地图片,请使用一些其他软件(应用程序)。

多年来,我一直使用这个库(在 macOS 上运行 Apache),以便其他机器能够访问本地网络中的这些服务,效果非常好。再次感谢作者发布此文。

i have tested successfully.i have to add a index.html like this below.
image
image
image

in the index.html, i add some html "a" tag and all of them is picture link,and in the same dir,the gallery.html will load the index.html and scans it in order to find out what images are available.but unfortunately,it seems that it cannot think "https://picsum.photos/200/300?1" as a picture link,it only think .png or other picture suffix pattern as a picture link and show it in gallery.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants