Comments (7)
some thoughts & questions:
- versions are not about thumbnails.
- what´s the problem with legacy media?
- what exactly are the benefits if we decouple the versions-app? because if you don´t need versions, it´s not in your way, right?
- how do you deal with images on a grid-based website if you don´t use versions?
thanks,
patrick
from django-filebrowser.
Hi Patrick.
- Of course, but generating thumbnails is one of the use cases.
- Most of the time legacy sites will have a pre-defined convention for filenames (or no convention at all), which will then render the very notion of selecting versions in the admin based on the filenames impossible.
- Filebrowser could be more useful for more people and easier to extend if it can provide base classes for
FileObject
andFileBrowserSite
that don't make assumptions about how a site generates images. Then on top of that, provide aversions
app that expands on this base. That achieves a cleaner code base since you are decoupling two features that are different in nature (file management and image generation). - I do more or less the same thing, generate different sized versions of the same image. The difference is in the implementation, since images sizes are requested by the site templates and resizing takes place using sorl-thumbnail on a task queue. It has no relation to the admin at all, it's transparent for site editors since they only have to choose the original files.
The whole issue is about refactoring it so people can use it for what the name implies (browsing files), and use more robust libraries for dealing with images since not all sites do this the same way.
from django-filebrowser.
some additional notes.
about 2: you usually don't select versions with the admin interface. actually, versions are only useful in the admin if you need to add them with a rich-text-editor.
maybe I'm not getting the point?
about 3: I do agree with the cleaner code.
about 4: how is that different to what we do with versions? editors also choose original files and versions are requested by templates.
@vam: your opinion about this issue?
I'm personally seeing some benefits in decoupling the versions app. but I don't think its important enough to do it ourselves - esp. since we're doing quite well with the current implementation of versions.
from django-filebrowser.
about 2: you usually don't select versions with the admin interface. actually, versions are only useful in the admin if you need to add them with a rich-text-editor.
Yes, that's what I meant. Also, the "versions" pane on file details and the previews are superfluous if you don't need it. On top of that, by defining an empty VERSIONS
setting, the code will break in various places.
about 4: how is that different to what we do with versions? editors also choose original files and versions are requested by templates.
It's different in how the image versions are actually created. The versions logic is builtin on the FileObject
accessors and in the management commands. You don't control "when" an image version is created, for instance. Also, you can't delegate image creation to another server to off-load your main web server. This is important in high-traffic sites since generating versions on the fly is not plausible, and running the management command for millions of legacy files is also impossible. So this sort of logic is very specific and varies on a per-site basis. It should have no relation with the rest of the app, which should just provide a file manager interface.
Anyway... I'm sure it's not useful to remove it for you, since you created the feature to actually use it :) But it's about making FileBrowser
more reusable.
I'll come up with a patch soon for this since I want to use filebrowser in a long-term project and don't want to maintain my own incompatible fork with versions removed. Given how easy it was for me to "take out" this feature, I envision it won't be hard to refactor.
from django-filebrowser.
empty versions don't make sense. you need at least one version for the admin-thumbnail.
looking forward to see your patch.
from django-filebrowser.
Sounds like a good idea to me - see the benefits of cleanness, reusability, and performance. Also curious about the patch.
Solving the admin-thumbnail problem without duplicating code in the versions-free filebrowser
and filebrowser.versions
seems like a challenge to me, though.
from django-filebrowser.
There you go, first attempt: Issue #46
from django-filebrowser.
Related Issues (20)
- Modal position is out of the window. HOT 5
- Refused to connect HOT 8
- Frame loaded with http protocol HOT 4
- No clear settings HOT 4
- Select buttons disappear when Filebrowser called from CKEditor after upgrade HOT 1
- Issue with latest version
- 未来filebrowser是否考虑会添加webdev支持
- Add a `--force` flag to `python manage.py fb_version_generate`
- Should remove providing_args from the Signals
- ifequals is depreciated HOT 1
- FileBrowser is not compatible with Django 4? HOT 2
- FileBrowser permissions HOT 2
- override upload_to on save model method HOT 4
- Files with more than one extension (examples: .tar.gz, .tar.xz) are not permitted by _isAllowedExtension in filebrowser.js HOT 1
- Broken thumbnail with default settings HOT 1
- admin permission HOT 1
- doesnt work with pillow 10, please fix requirements.txt HOT 1
- Moving files between folders HOT 2
- Use absolute path for directory HOT 1
- Make Grappelli optional HOT 2
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 django-filebrowser.