Commit 5768a6f3 authored by Guido Günther's avatar Guido Günther
Browse files

Merge branch 'update_0.16.0' into 'debian/latest'

Update 0.16.0

See merge request DebianOnMobile-team/megapixels!4
parents c527b8b5 d2a0ad7d
......@@ -2,7 +2,7 @@
A GTK3 camera application that knows how to deal with the media request api
irc: #megapixels on freenode
chat: #megapixels:postmarketos.org on matrix
## Building
......
megapixels (0.16.0-1) experimental; urgency=medium
* New upstream release 0.16.0
-- Evangelos Ribeiro Tzaras <devrtz-debian@fortysixandtwo.eu> Tue, 27 Apr 2021 09:24:54 +0200
megapixels (0.15.0-1) experimental; urgency=medium
* New upstream release 0.15.0
......
......@@ -343,7 +343,8 @@ preview_draw(GtkWidget *widget, cairo_t *cr, gpointer data)
for (uint8_t i = 0; i < zbar_result->size; ++i) {
MPZBarCode *code = &zbar_result->codes[i];
cairo_set_source_rgba(cr, 1, 1, 1, 0.5);
cairo_set_line_width(cr, 3.0);
cairo_set_source_rgba(cr, 0, 0.5, 1, 0.75);
cairo_new_path(cr);
cairo_move_to(cr, code->bounds_x[0], code->bounds_y[0]);
for (uint8_t i = 0; i < 4; ++i) {
......@@ -420,6 +421,12 @@ on_shutter_clicked(GtkWidget *widget, gpointer user_data)
mp_io_pipeline_capture();
}
void
on_capture_shortcut(void)
{
on_shutter_clicked(NULL, NULL);
}
static bool
check_point_inside_bounds(int x, int y, int *bounds_x, int *bounds_y)
{
......@@ -444,9 +451,8 @@ on_zbar_code_tapped(GtkWidget *widget, const MPZBarCode *code)
{
GtkWidget *dialog;
GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT;
bool data_is_url = strncmp(code->data, "http://", 7) == 0
|| strncmp(code->data, "https://", 8) == 0
|| strncmp(code->data, "gemini://", 9) == 0;
bool data_is_url = g_uri_is_valid(
code->data, G_URI_FLAGS_PARSE_RELAXED, NULL);
char* data = strdup(code->data);
......@@ -489,7 +495,7 @@ on_zbar_code_tapped(GtkWidget *widget, const MPZBarCode *code)
case GTK_RESPONSE_YES:
if (!g_app_info_launch_default_for_uri(data,
NULL, &error)) {
g_printerr("Could not launch browser: %s\n",
g_printerr("Could not launch application: %s\n",
error->message);
}
case GTK_RESPONSE_ACCEPT:
......@@ -761,6 +767,17 @@ main(int argc, char *argv[])
gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
GClosure* capture_shortcut = g_cclosure_new(on_capture_shortcut, 0, 0);
GtkAccelGroup* accel_group = gtk_accel_group_new();
gtk_accel_group_connect(accel_group,
GDK_KEY_space,
0,
0,
capture_shortcut);
gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
mp_io_pipeline_start();
camera = mp_get_camera_config(0);
......
......@@ -66,7 +66,7 @@ if [ -n "$DCRAW" ]; then
# If imagemagick is available, convert the tiff to jpeg and apply slight sharpening
if [ -n "$CONVERT" ];
then
if [ "$CONVERT" == "convert" ]; then
if [ "$CONVERT" = "convert" ]; then
convert "$MAIN_PICTURE.$TIFF_EXT" -sharpen 0x1.0 "$TARGET_NAME.jpg"
else
gm convert "$MAIN_PICTURE.$TIFF_EXT" -sharpen 0x1.0 "$TARGET_NAME.jpg"
......
......@@ -357,10 +357,23 @@ process_capture_burst(cairo_surface_t *thumb)
char timestamp[30];
strftime(timestamp, 30, "%Y%m%d%H%M%S", &tim);
sprintf(capture_fname,
"%s/IMG%s",
g_get_user_special_dir(G_USER_DIRECTORY_PICTURES),
timestamp);
if (g_get_user_special_dir(G_USER_DIRECTORY_PICTURES) != NULL) {
sprintf(capture_fname,
"%s/IMG%s",
g_get_user_special_dir(G_USER_DIRECTORY_PICTURES),
timestamp);
} else if (getenv("XDG_PICTURES_DIR") != NULL) {
sprintf(capture_fname,
"%s/IMG%s",
getenv("XDG_PICTURES_DIR"),
timestamp);
} else {
sprintf(capture_fname,
"%s/Pictures/IMG%s",
getenv("HOME"),
timestamp);
}
// Start post-processing the captured burst
g_print("Post process %s to %s.ext\n", burst_dir, capture_fname);
......@@ -424,6 +437,7 @@ mp_process_pipeline_process_image(MPImage image)
// If we haven't processed the previous frame yet, drop this one
if (frames_received != frames_processed && !is_capturing) {
printf("Dropped frame at capture\n");
free(image.data);
return;
}
......
......@@ -160,6 +160,7 @@ mp_zbar_pipeline_process_image(cairo_surface_t *surface)
{
// If we haven't processed the previous frame yet, drop this one
if (frames_received != frames_processed) {
cairo_surface_destroy(surface);
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment