From patchwork Wed Jul 6 10:18:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 16562 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A7890BD1F1 for ; Wed, 6 Jul 2022 10:18:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0AA5E63311; Wed, 6 Jul 2022 12:18:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657102725; bh=5FsbFz2rxnf0KR6y5J6BXxva5T3QeWoXql4B0h6nlF8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=j2CND4XFaCk9kSzgmS0NStYnWw8Sp64boGcysL0dcEHPVMQgTnqS9mZYfZHPz4oFg FDAZdTxvfJMAwe3yQ9P55YSTDlzGGYykBiTeB4yfK0Ij+iQOaTHA3LeZIn8lmWywEQ 9EdwxcDoGystBKfh9E+V1DsVgQJMexKOIIEybuLlZbLxmG69/Em95Qp8FX1pO+Ect5 u2Rx+7z5SY68Mi/zDKdAyx5wkbSdIyj05cD7lRX4ZonABqgy03fgZCOKMD3PulCW3o 6ewL3b9duGShCp1Hh5PL5wM2fbGO8n7ou95PIYt3jlmRn7BXCbxfZVuPH8cmUpeMK9 KNqOxNYnnEkBQ== Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB11F6330C for ; Wed, 6 Jul 2022 12:18:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="O47he72w"; dkim-atps=neutral Received: by mail-wr1-x432.google.com with SMTP id q9so21355438wrd.8 for ; Wed, 06 Jul 2022 03:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Wc2GJ1T1krXJ6ZHwNTDoiOGNKOl2Qvj3QnBeLDfseAc=; b=O47he72wSIUO0sOKCobeqiEc1OgEu0KzOvCk3L4cp5fOyRwZyPcAlzxWk3PzeJODEN pCb58vXz2b5YiDCXuZLfCvgEIwpWtpnfCIqyD5zz3VE5VEBwzQESF37Sl6YSnic4mkAk 6Xx1RIaxNxZxUqp/oFPDKz+6zVRyNyxj4aaLZLdX8cmdvujBBpmUUh/86vWo7m1ZKFXM 1Umy+gEij2nYfwRIZB+Oaib9UMz2at7H0nW3HGySKpFOXgyrgohR0zB7vBnbb0NcHN18 am6vdcLxiEJl8CJazuPFkFbzMnJdMKo5nG306JpggcGqr1TduJGza1hDyuhQ/jrkped9 iw3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wc2GJ1T1krXJ6ZHwNTDoiOGNKOl2Qvj3QnBeLDfseAc=; b=3CixIkqYvS/iLziyfKZ81N6SHSGt+A/fMf6PsZdW9FlI5k1CxqJhxPHzusIm7wx6M4 OlGdlKci/+1gKUGD8DlQFj7UJb3esfsKJ7kHmwOL4vXQvJa0MsGCZ7DZVFD5DxNLuzAI +4dLVJNgIlAeJMoMampgBJp+nYc0vllURzTn375ufY81i8nfHAjBGlW3ajCayIs/JhyM ePklQy8lp6S1hmIECCgus1Ym//v76vHbg+jmDhcR29tB+RmfjM28Jof5p84w2FhDreFS gKwRW+O1+aoVr9A74BhII2lAxjzTM0C41oQ5DyqFQVUqZvVrWcg9SFlJPb1IxC29hXZ1 Z5cA== X-Gm-Message-State: AJIora/tnih5NXK+A/Ey4hP5XOs9HK14x4y3XftbCv6Q6O28+wmXGAoV FpqDkKfFvtjW3+Ecu+T/p5v+mJa2zeRg9Q== X-Google-Smtp-Source: AGRyM1v7JmRFIjT7PcxhrUbbC7K1qkbQJIf14e7U8U9mDM8ko6esX4zTp6fhsM9XmEgllp0CIWmdZA== X-Received: by 2002:a05:6000:168a:b0:21b:b8a4:799 with SMTP id y10-20020a056000168a00b0021bb8a40799mr38269452wrd.56.1657102721405; Wed, 06 Jul 2022 03:18:41 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:e4a2:3070:eea4:e434]) by smtp.gmail.com with ESMTPSA id i1-20020adffc01000000b0021b5861eaf7sm35950820wrr.3.2022.07.06.03.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 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 Subject: [libcamera-devel] [PATCH 1/3] utils: raspberrypi: ctt: load_image: Ignore JPEG files with no raw data X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: David Plowman via libcamera-devel From: David Plowman Reply-To: David Plowman Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: William Vinnicombe The load_image function would throw errors with JPEG or JPG files containing no raw data. Prevent throwing these errors by returning 0 if an error has occurred. Signed-off-by: William Vinnicombe Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- utils/raspberrypi/ctt/ctt_image_load.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/raspberrypi/ctt/ctt_image_load.py b/utils/raspberrypi/ctt/ctt_image_load.py index 66adb237..934db123 100644 --- a/utils/raspberrypi/ctt/ctt_image_load.py +++ b/utils/raspberrypi/ctt/ctt_image_load.py @@ -358,6 +358,11 @@ def load_image(Cam, im_str, mac_config=None, show=False, mac=True, show_meta=Fal Img = dng_load_image(Cam, im_str) else: Img = brcm_load_image(Cam, im_str) + """ + handle errors smoothly if loading image failed + """ + if Img == 0: + return 0 if show_meta: Img.print_meta()