[general]
name=Granulometria por Fotointerpretacion
qgisMinimumVersion=3.22
description=Measures rock grain sizes in a photo by photointerpretation and exports gradation reports.
about=Granulometria por Fotointerpretacion (Photointerpretation Grain Size Analysis) measures the size of rock grains in a georeferenced photo, typically captured by drone. The user draws the photo outline to obtain the total area, then draws or adjusts grain polygons (for example, produced by a segmentation tool such as GeoAI/Segment Anything). The plugin filters grains by a sieve-size threshold - grains below it are removed from the polygon layer and their area is counted as fine material - computes coarse/fine areas and percentages, and exports: (1) an Excel workbook with area/diameter data in a fixed template layout, (2) a second Excel workbook with image and material summary information, and (3) a GeoPackage bundling the polygon layer, the source photo raster, and an embedded QGIS project, exported as-is in the project's coordinate system (no reprojection). It also offers an optional lossless cropping step and a photo-labelling tab (date, free text and your own logo) for report evidence. No external Python packages are required: the plugin only uses Qt (via qgis.PyQt) and qgis.core/qgis.gui, all of which ship with QGIS.
version=1.0.7
author=Jean Pardo
email=jeandariopardo@gmail.com
homepage=https://github.com/PardoJean/GranulometriaPorFotointerpretacion
tracker=https://github.com/PardoJean/GranulometriaPorFotointerpretacion/issues
repository=https://github.com/PardoJean/GranulometriaPorFotointerpretacion
icon=icon.png
experimental=False
deprecated=False
supportsQt6=True
category=Plugins
tags=granulometry,grain size,particle size,gradation curve,sieve,geotechnics,soil,rock,aggregate,mining,quarry,photointerpretation,photogrammetry,drone,uav,orthophoto,segmentation,image analysis,raster,vector,polygon,area,report,excel,geopackage,astm

changelog=1.0.7 - "Export All" is now a single "Save as..." step: pick a location and name, and the plugin creates a new folder with that name plus a date/time stamp, saving the three output files inside it with that same stamped name. Repeated exports of the same sample no longer overwrite each other or mix with other samples' files in the same folder.
    1.0.6 - "Label Photo" tab: the photo is now picked with a file browser (any .png/.jpg/.tif on disk, opening in the folder of the photo already selected in "Prepare Photo") instead of requiring it to already be a loaded raster layer. The white background outside the photographed area is no longer replaced with black - the photo is exported with its original background (landscape rotation for portrait photos is kept). The free-text field's placeholder now suggests a sample number as an example. Section titles and the layer/photo selection labels are now bold and larger, easier to spot at a glance.
    1.0.5 - The plugin no longer requires a polygon layer to already exist in the project to be opened. Previously it refused to open at all on an empty project, showing an error and nothing else; now the dialog opens with the polygon-layer selector empty, the same way it already handled an empty photo selector, and "Process Layer"/"Export All" still warn if you press them with no layer selected.
    1.0.4 - Fixed "Use raster outline" silently shifting the total-area contour and its computed area when the project's CRS differed from the photo's. These lab photos carry a real-sounding CRS name (e.g. PSAD56/UTM) but their coordinates are only a local scale reference, not a real geodetic position; reprojecting between CRSs on top of that produced a plausible-looking but wrong, displaced outline instead of an error. The plugin no longer reprojects it - it now warns and stops if the project CRS doesn't already match the photo's, asking the user to set them equal first.
    1.0.3 - First stable (non-experimental) release. Fixes a quantisation bug that rounded grain diameters to 2 decimals in metres (1 cm steps), corrupting the exported diameter column and the finer sieves of the gradation curve - diameters now keep 4 decimals. The real-pixel-footprint computation no longer unions thousands of speckle polygons one by one (which could freeze QGIS for minutes on a large drone orthophoto) and closes its GDAL dataset. The drawing tool no longer leaves the dialog hidden forever when another QGIS tool is picked mid-drawing, and is deactivated when the dialog closes instead of firing callbacks into a destroyed dialog. Added guards for an empty polygon layer, a self-intersecting total-area outline and a photo without a valid CRS, which previously produced silently wrong percentages. The plugin's own "no polygon layers" message is now shown as an error instead of a green success banner. Declared qgisMinimumVersion raised from 3.0 to 3.22, the real API floor (writeAsVectorFormatV3 and scoped enums do not exist before it).
    1.0.2 - New optional photo-cropping step before analysis (free-form polygon, no quality loss), drawable by segment, by flow, or as a rectangle - the same three modes also available for the total-area outline, which now shows and lets you pick which photo it acts on (synced with the "Prepare Photo" selector). Total area is computed from the raster's real pixel footprint instead of its bounding box, fixing up to ~39%% overestimation on photos with a transparent border. The temporary total-area layer is removed from the layer panel right after a successful export. Main dialog reorganised into tabs (Prepare Photo / Analyse / Label Photo) with a native QGIS look (inherited theme and font, QGIS's own icons instead of emoji) and visible keyboard focus. New "Label Photo" tab: stamps the date (calendar picker) with a free text stacked above it (both bottom-left), plus a private, remembered logo (bottom-right); text/logo size default to a fixed 60px/800px; the white padding these lab photos have outside the actually-photographed area is replaced with solid black and the photo rotated to landscape when portrait, so the exported file matches the preview exactly; suggested filename is the date; wrapped in its own scroll area so it doesn't stretch the other tabs. "Process Layer" no longer opens the attribute table. Added a license/contact notice (GPLv3; commercial use/adaptation asked to go through the author first).
    1.0.1 - Qt6 compatibility fixes: fully-qualified enums, imports via qgis.PyQt instead of PyQt5, exec_() renamed to exec(). Removed a silent except/pass in the GeoPackage overview-building step (now logs the error instead of discarding it).
    1.0.0 - First public release.
