Comments (14)
Yes, no need to rush here. Let’s wait. Thanks and enjoy the weekend!
from kirby-colorextractor.
Do you have a specific setup? Does it happens with the upload hook or the button ?
I still probably lack understanding of k3's images behavior at this point, I don't understand how images would be prefixed with media
in an installation but not another.
from kirby-colorextractor.
@sylvainjule happens with the button in the panel. my folder structure is similar to the one in devkit https://github.com/k-next/devkit to keep everything except the entrypoint outside the domain root.
the media folder will be created in public
by kirby.
there is also the https://nnnnext.getkirby.com/docs/cheatsheet/roots/media function which should return the path
from kirby-colorextractor.
Thanks, I probably won't be able to take a look tomorrow but I will asap!
from kirby-colorextractor.
no problem, thanks!
from kirby-colorextractor.
@sylvainjule did you find some time to look into this? i would love to use it for a site which launches on monday. it would be a nice addition, nothing road blocking. no prob if you don't find some time, i'll stick with my current plan then… thx!
from kirby-colorextractor.
I'm having a look now but I can't reproduce this with a fresh devkit... colors are extracted as they should and no errors thrown.
Perhaps you could zip me a truncated version of your setup, changing the content if confidential, etc. so that I can debug on the correct folder structure?
from kirby-colorextractor.
Also could you screenshot me the response / error thrown ?
from kirby-colorextractor.
@sylvainjule responses from http://localhost:8000/plugins/colorextractor/process-image
are coming back with the following json:
{
"status":"error",
"error":"file_get_contents(\/media\/pages\/pageid\/myimage-300x200-q90.jpg): failed to open stream: No such file or directory"
}
for various reasons (reverse proxy, docker, ci) i had to set 'url' => '/'
in my config and i think therefore file_get_contents()
looks in server root. apart from not finding anything, this is also a potential security issue.
from kirby-colorextractor.
Ok thanks, with this config tweak I get the same error.
But since kirby has been told to rewrite its urls we can't rely on $kirby->url('media')
either as it returns the same prefix. Looking for a workaround.
from kirby-colorextractor.
The last commit fixes it for me.
(be careful though, I still need to set a cache for the plugin, I'm relying a lot on $site->index()
for now, if your website is content-heavy it might not like it)
from kirby-colorextractor.
just pretty quick:
But since kirby has been told to rewrite its urls we can't rely on $kirby->url('media') either as it returns the same prefix.
Url rewriting doesnt matter here imo as its about the absolute file system/disk path via $kirby->roots()
https://nnnnext.getkirby.com/docs/framework/cms/app/roots
from kirby-colorextractor.
My bad, within the new docs, what should have been $kirby->roots()->media()
is shown as $kirby->url('media')
, which returns the url of the folder, not its disk path.
Actually the better way would be to call $thumb->root()
or $thumb->mediaRoot()
, but I can't go with it right now as there is an issue with the $thumb object, this is why I went for url
. Probably best to wait for its fix than getting lost in quickfixes that will need to be changed in the end.
from kirby-colorextractor.
Should be fixed, switched to root()
. ✅
Don't hesitate to reopen if not.
from kirby-colorextractor.
Related Issues (13)
- screenshots
- Add option in panel to delete previously extracted colors / re-extract colors HOT 2
- Image must be a gd resource HOT 7
- Choosing between dominant/average HOT 1
- Field method toColor('average') returns the dominant color in extract mode => 'both' HOT 5
- PHP fatal error in console
- [K4] 4.0 Compatibility HOT 1
- PHP Notice: Use of undefined constant DS HOT 1
- When uploading an svg file to the panel HOT 2
- Call to a member function find() on array HOT 2
- Request: Store dominant and average colors
- Kirby 3.4 compatibility HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby-colorextractor.