{"id":16562,"url":"https://patchwork.libcamera.org/api/patches/16562/?format=json","web_url":"https://patchwork.libcamera.org/patch/16562/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220706101836.20153-2-david.plowman@raspberrypi.com>","date":"2022-07-06T10:18:34","name":"[libcamera-devel,1/3] utils: raspberrypi: ctt: load_image: Ignore JPEG files with no raw data","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"83c22391571aee8df3a8d6e6421d3538da6f85b8","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16562/mbox/","series":[{"id":3261,"url":"https://patchwork.libcamera.org/api/series/3261/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3261","date":"2022-07-06T10:18:33","name":"Raspberry Pi tuning tool improvements","version":1,"mbox":"https://patchwork.libcamera.org/series/3261/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16562/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16562/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A7890BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Jul 2022 10:18:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0AA5E63311;\n\tWed,  6 Jul 2022 12:18:45 +0200 (CEST)","from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB11F6330C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Jul 2022 12:18:41 +0200 (CEST)","by mail-wr1-x432.google.com with SMTP id q9so21355438wrd.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 06 Jul 2022 03:18:41 -0700 (PDT)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\ti1-20020adffc01000000b0021b5861eaf7sm35950820wrr.3.2022.07.06.03.18.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 06 Jul 2022 03:18:41 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657102725;\n\tbh=5FsbFz2rxnf0KR6y5J6BXxva5T3QeWoXql4B0h6nlF8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=j2CND4XFaCk9kSzgmS0NStYnWw8Sp64boGcysL0dcEHPVMQgTnqS9mZYfZHPz4oFg\n\tFDAZdTxvfJMAwe3yQ9P55YSTDlzGGYykBiTeB4yfK0Ij+iQOaTHA3LeZIn8lmWywEQ\n\t9EdwxcDoGystBKfh9E+V1DsVgQJMexKOIIEybuLlZbLxmG69/Em95Qp8FX1pO+Ect5\n\tu2Rx+7z5SY68Mi/zDKdAyx5wkbSdIyj05cD7lRX4ZonABqgy03fgZCOKMD3PulCW3o\n\t6ewL3b9duGShCp1Hh5PL5wM2fbGO8n7ou95PIYt3jlmRn7BXCbxfZVuPH8cmUpeMK9\n\tKNqOxNYnnEkBQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:subject:date:message-id:in-reply-to:references:mime-version\n\t:content-transfer-encoding;\n\tbh=Wc2GJ1T1krXJ6ZHwNTDoiOGNKOl2Qvj3QnBeLDfseAc=;\n\tb=O47he72wSIUO0sOKCobeqiEc1OgEu0KzOvCk3L4cp5fOyRwZyPcAlzxWk3PzeJODEN\n\tpCb58vXz2b5YiDCXuZLfCvgEIwpWtpnfCIqyD5zz3VE5VEBwzQESF37Sl6YSnic4mkAk\n\t6Xx1RIaxNxZxUqp/oFPDKz+6zVRyNyxj4aaLZLdX8cmdvujBBpmUUh/86vWo7m1ZKFXM\n\t1Umy+gEij2nYfwRIZB+Oaib9UMz2at7H0nW3HGySKpFOXgyrgohR0zB7vBnbb0NcHN18\n\tam6vdcLxiEJl8CJazuPFkFbzMnJdMKo5nG306JpggcGqr1TduJGza1hDyuhQ/jrkped9\n\tiw3Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"O47he72w\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Wc2GJ1T1krXJ6ZHwNTDoiOGNKOl2Qvj3QnBeLDfseAc=;\n\tb=3CixIkqYvS/iLziyfKZ81N6SHSGt+A/fMf6PsZdW9FlI5k1CxqJhxPHzusIm7wx6M4\n\tOlGdlKci/+1gKUGD8DlQFj7UJb3esfsKJ7kHmwOL4vXQvJa0MsGCZ7DZVFD5DxNLuzAI\n\t+4dLVJNgIlAeJMoMampgBJp+nYc0vllURzTn375ufY81i8nfHAjBGlW3ajCayIs/JhyM\n\tePklQy8lp6S1hmIECCgus1Ym//v76vHbg+jmDhcR29tB+RmfjM28Jof5p84w2FhDreFS\n\tgKwRW+O1+aoVr9A74BhII2lAxjzTM0C41oQ5DyqFQVUqZvVrWcg9SFlJPb1IxC29hXZ1\n\tZ5cA==","X-Gm-Message-State":"AJIora/tnih5NXK+A/Ey4hP5XOs9HK14x4y3XftbCv6Q6O28+wmXGAoV\n\tFpqDkKfFvtjW3+Ecu+T/p5v+mJa2zeRg9Q==","X-Google-Smtp-Source":"AGRyM1v7JmRFIjT7PcxhrUbbC7K1qkbQJIf14e7U8U9mDM8ko6esX4zTp6fhsM9XmEgllp0CIWmdZA==","X-Received":"by 2002:a05:6000:168a:b0:21b:b8a4:799 with SMTP id\n\ty10-20020a056000168a00b0021bb8a40799mr38269452wrd.56.1657102721405; \n\tWed, 06 Jul 2022 03:18:41 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org, william.vinnicombe@raspberrypi.com","Date":"Wed,  6 Jul 2022 11:18:34 +0100","Message-Id":"<20220706101836.20153-2-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20220706101836.20153-1-david.plowman@raspberrypi.com>","References":"<20220706101836.20153-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/3] utils: raspberrypi: ctt: load_image:\n\tIgnore JPEG files with no raw data","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: William Vinnicombe <william.vinnicombe@raspberrypi.com>\n\nThe load_image function would throw errors with JPEG or JPG files containing\nno raw data.\n\nPrevent throwing these errors by returning 0 if an error has occurred.\n\nSigned-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>\n---\n utils/raspberrypi/ctt/ctt_image_load.py | 5 +++++\n 1 file changed, 5 insertions(+)","diff":"diff --git a/utils/raspberrypi/ctt/ctt_image_load.py b/utils/raspberrypi/ctt/ctt_image_load.py\nindex 66adb237..934db123 100644\n--- a/utils/raspberrypi/ctt/ctt_image_load.py\n+++ b/utils/raspberrypi/ctt/ctt_image_load.py\n@@ -358,6 +358,11 @@ def load_image(Cam, im_str, mac_config=None, show=False, mac=True, show_meta=Fal\n             Img = dng_load_image(Cam, im_str)\n         else:\n             Img = brcm_load_image(Cam, im_str)\n+        \"\"\"\n+        handle errors smoothly if loading image failed\n+        \"\"\"\n+        if Img == 0:\n+            return 0\n         if show_meta:\n             Img.print_meta()\n \n","prefixes":["libcamera-devel","1/3"]}