Add editing media features into the app gallery#37
Conversation
* Edit view is created as a navigation page and opened from the setttings of the mediaView page. * Add initial layout for the editing bar at the bottom. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
… database and refresh media_view and grid_view. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…self already. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…the widget. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…for the user. Its very bare bones right now, it resets everytime you click outside of the image, but, a win is a win. * The actual saving to storage and cropping is yet to be added, this ony GTK4 so far. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
* Use high-quality (95%) JPEG encoding since JPEG is lossy and byte-for-byte preservation is not possible. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…or overwritting the current image. * Use the cropping function from media tools. * TODO: Refresh edit view, media view, grid view (probably usng a signal when changed in database will help me avoid the other multiple signal path." Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…k.Stroke. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…ar that has stroke color and size options. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…e coordinates. Therefore, implement a simple coordinate frame change helper. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…tures. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…and encode with GdkPixbuf for non-PNG formats. For some reason, cairo can only saved directly to PNG, so to maintain image, we convert to pixbuff and save it from there. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…mponent reutilizable. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…s a css class to the image. TODO: Save the transformed image. I also noticed that we can create the bar in the class and just return it to the parent context. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…e not linear, so we cant just linearly increase each channel, so for now, lets use a naive solution. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…nformations in 8-bit channels. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…the actual images. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
… the directories ~/Pictures and ~/Videos. * This one also checks albums within root ones recursively. * I still need to use events to update the UI components, but for now it detects new files created, copied and edited from edit_view. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…aling of new files created. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
* Solves issue: #36. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…pport for videos yet. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
… file is added. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
… handled as well. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…bject. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
… title and give a default case. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…nstead of a new instance. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…els take up to 30s to complete and it can trigger a Wayland compositor disconnect. TODO: Find a way to use GPU acceleration or a quicker way to perform the blur. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
|
whats the status of this |
…om NavigationView. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
…his one does not update on delete, since its an attribute of the flowbox child set by us. Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
|
So far: Problem: I tried using the TFT but its c++ based, So im stuck into seeing how to make the algorithms faster or how to off load the operators to a c++ object and call it when needed. |
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
Signed-off-by: Joaquin Philco <joaquinphilco@hotmail.com>
|
|
||
| return np.stack([R, G, B], axis=-1) | ||
|
|
||
| class FuriOSMediaTools: |
There was a problem hiding this comment.
everything in this class is a staticmethod with no class variables. maybe split this file to color_space_standards that house the aforementioned class, and rename this file to media_tools then move everything outside FuriOSMediaTools. open to ideas.
you also throw lots of ValueError, FileNotFoundError and TypeError here. are they ever caught?
| ) | ||
|
|
||
| self.on_drawing_cancel_clicked(btn) | ||
|
|
| return self.bar | ||
|
|
||
| def build_crop_bar(self): | ||
| if getattr(self, "crop_bar", None): |
There was a problem hiding this comment.
where is self.crop_bar defined/used? if defined at all, why not initialize it to a default value in __init__ and check for if self.crop_bar?
| self, | ||
| picture_widget: Gtk.Widget, | ||
| texture: Gdk.Texture, | ||
| *, |
There was a problem hiding this comment.
you don't really need this, we own the internal API, no need to enforce positional arguments
| self.edit_bar = bar | ||
|
|
||
| def set_edit_bar_visible(self, visible: bool): | ||
| if getattr(self, "edit_bar", None): |
There was a problem hiding this comment.
initialize self.edit_bar to None in __init__ and use if self.edit_bar instead of getattr
| def on_cancel_clicked(self, btn=None): | ||
| if callable(getattr(self, "on_cancel", None)): | ||
| self.on_cancel() | ||
|
|
||
| def on_apply_clicked(self, btn=None): | ||
| if callable(getattr(self, "on_apply", None)): | ||
| self.on_apply(getattr(self, "selected_filter", "filter-original")) |
There was a problem hiding this comment.
initialize on_cancel and on_apply and set to None in init and use if self.on_cancel and if self.on_apply
| self.zoomable_image.set_zoom_enabled(False) | ||
| self.set_edit_bar_visible(False) | ||
|
|
||
| if getattr(self, "draw_overlay", None): |
There was a problem hiding this comment.
initialize self.draw_overlay set to None in init and use if self.draw_overlay
| self.draw_overlay.queue_draw() | ||
|
|
||
| def on_drawing_cancel_clicked(self, _btn=None): | ||
| draw = getattr(self, "draw_overlay", None) |
| def on_cancel_clicked(self, _btn): | ||
| if callable(getattr(self, "on_cancel", None)): | ||
| self.on_cancel() | ||
|
|
||
| def on_apply_clicked(self, _btn): | ||
| if callable(getattr(self, "on_apply", None)): | ||
| self.on_apply(getattr(self, "selected_filter", "filter-original")) |
There was a problem hiding this comment.
initialize on_cancel and on_apply and set to None in init and use if self.on_cancel and if self.on_apply
|
|
||
| def set_zoom_enabled(self, enabled: bool): | ||
| self.zoom_enabled = enabled | ||
| if not enabled and getattr(self, "zoom_gesture", None): |
There was a problem hiding this comment.
initialize self.zoom_gesture to None in __init__ and check if self.zoom_gesture
This PR adds the following features into the gallery:
--> File name editing within mediaView and editView Navigation pages.
--> Ability to crop an image
--> Ability to add predetermined filters into pictures only
Tho it is imperative to say that this is only for pictures, no video editing has been applied at all.
This PR also fixes the following issues:
#29
#36