Comments (9)
@agusmakmun will push a demo app for this!
from django-image-optimizer.
@yeole-rohan currently we didn't support to crop the image by using axis.
for the fast response might this answer will help you (by using Pillow) https://stackoverflow.com/a/20361739/6396981
meanwhile, if you have any MR that related with this,
I'll be happy to support it as well.
for example:
from image_optimizer.fields import OptimizedImageField
from .yourpackage import custom_image_optimizer
class CustomOptimizedImageField(OptimizedImageField):
"""An ImageField that gets optimized on save() using tinyPNG."""
def save_form_data(self, instance, data):
"""Remove the OptimizedNotOptimized object on clearing the image."""
# Are we updating an image?
updating_image = True if data and getattr(instance, self.name) != data else False
if updating_image:
data = custom_image_optimizer(...)
super().save_form_data(instance, data)
from django-image-optimizer.
from django-image-optimizer.
from django-image-optimizer.
hello @yeole-rohan thank you for creating new MR, we appreciate about your nice contribution
can you please also provide an unitest for that as well?
from django-image-optimizer.
@agusmakmun I have created a demo app inside yours demo app.
This app defined basic upload and cropping of image through axis.
- Its on developer to user cropping library and how to pass x,y from image to our function.
- I personally suggest cropper.js for this.
let me know if changes required.
looking ahead to merge.
from django-image-optimizer.
hello @yeole-rohan, thank so much for your contribution, we have merged your PR: #7 to #8
and I have pushed to new tag as well, you can try:
pip install django-image-optimizer --upgrade
then;
from image_optimizer.utils import crop_image_on_axis
...
for more:
django-image-optimizer/image_optimizer/utils.py
Lines 118 to 126 in 1327229
from django-image-optimizer.
from django-image-optimizer.
yeah, that's fine. and really appreciate if you doing that.
from django-image-optimizer.
Related Issues (5)
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-image-optimizer.