<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cradicle Explorer</title>
    <link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
      .form-control-dark::placeholder {
          color: #aaa;
          opacity: 1;
      }
    </style>
    <link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
    <link rel="icon" type="image/png" href="/favicon.png">


                <link href="/css/dashboard.css" rel="stylesheet">
                </head>
                <body>
                <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
                  <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/">Cradicle Explorer</a>
                  <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <form method="get" action="/cgi-bin/main" style="width:100%;"><input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" name="q" placeholder="Search repos" aria-label="Search"></form>
                  <div class="navbar-nav flex-row">
                    <div class="nav-item text-nowrap">
                      <a class="nav-link px-3 active" href="/cgi-bin/repo?id=z3WPUhd6gyfKgidXQe46V5Qh2zep7">cropgui.git</a>
                    </div>
                  </div>
                </header>
                <div class="container-fluid">
                  <div class="row">
                    <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                      <div class="position-sticky pt-3 sidebar-sticky">
                        <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" href="/cgi-bin/repo?id=z3WPUhd6gyfKgidXQe46V5Qh2zep7">
                              <i class="align-text-bottom fa-solid fa-info"></i>
                              Info
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3WPUhd6gyfKgidXQe46V5Qh2zep7&issue=list">
                              <i class="align-text-bottom fa-solid fa-layer-group"></i>
                              Issues
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3WPUhd6gyfKgidXQe46V5Qh2zep7&patch=list">
                              <i class="align-text-bottom fa-solid fa-vest-patches"></i>
                              Patches
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3WPUhd6gyfKgidXQe46V5Qh2zep7&wallet=list">
                              <i class="align-text-bottom fa-solid fa-wallet"></i>
                              Wallets
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3WPUhd6gyfKgidXQe46V5Qh2zep7&source=.">
                              <i class="align-text-bottom fa-solid fa-code"></i>
                              Source
                            </a>
                          </li>
                        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
                          <span></span>
                        </h6>
                        <ul class="nav flex-column mb-2">
                        
                        </ul>
                      </div>
                    </nav>
                <main class="col-md-9 ms-sm-auto col-lg-10">
                  <div class="container px-1 py-3">
        

    <div class="list-group">
    <div class="list-group-item">
    <div style="font-size:1.3rem;">cropgui.git</div>
    <div class="repo-item">gtk frontend for lossless cropping of jpeg images</div>
    <div>rad:z3WPUhd6gyfKgidXQe46V5Qh2zep7</div>
    </div>
    <div class="list-group-item">
    <div>Visibility</div>
    <div class="repo-item">public</div>
    </div>
    <div class="list-group-item">
    <div>Delegates</div><div class="repo-item">did:key:z6MkrmvEJY7gDDQBso3T38xS6UXrS88dG47Ezfp1naw8XuMr</div>
    </div>
    <div class="list-group-item">
    <div>Default branch</div>
    <div><span class="repo-item">main &#8594 70e68bc77096b59e3ceebaf6e030a05395e9d153</span> (Tue Jul 23 15:14:14 2024)</div>
    </div>
    <div class="list-group-item">
    <div>Threshold</div>
    <div class="repo-item">1</div>
    </div>
    </div>
    
        <div class="list-group mt-3">
        <div class="list-group-item">
        <div class="mb-2" style="font-weight:bold;"><i class="fa-solid fa-book"></i> README.md</div>
        <pre style="margin:0; font-size:0.85rem; overflow-x:auto; color:#fafafa;"># A GTK GUI for lossless JPEG cropping

Of the pictures I&#x27;d like to put online, I&#x27;ve found that in 75% of the cases
where I want to retouch the photo, it&#x27;s to crop it and nothing else. Since I
shoot in jpeg, it&#x27;s a lossy process to load the jpeg in gimp, crop it, and
write the result.

It turns out that debian&#x27;s jpegtran has a &quot;-crop&quot; flag which performs lossless
cropping of jpeg images as long as the crop is to a multiple of what the
manpage calls the &quot;iMCU boundary&quot;, usually an 8x8 or 16x16 block of pixels.
This feature may have been pioneered by Guido of jpegclub.org some years ago.

There&#x27;s apparently a nice Windows front-end to this program, but I didn&#x27;t find
a Linux one. So I wrote one! It&#x27;s pretty basic, but it gets the job done. You
can download it below.

To run cropgui, either list files on the commandline or select them from a file
browser (in the latter case, you&#x27;re returned to the browser after cropping the
selected file(s); hit &#x27;cancel&#x27; to exit completely). The output filename is
chosen automatically, and never overwrites the original (but it will silently
overwrite an earlier cropped version). For example, if the input is &quot;moon.jpg&quot;
then the output is &quot;moon-cropped.jpg&quot;.

Images are automatically scaled by a power of 2 (e.g., 1/2, 1/4 or 1/8) in
order to fit onscreen. While dragging, the cropped image boundary will snap
to a multiple of 8 or 16 pixels; this represents the limitation that the
upper-left corner must be at a multiple of the iMCU blocks.

## PREREQUISITES

cropgui is written in Python and requires the following packages:
 * Debian: python3, python3-pil, python3-pil.imagetk, libjpeg-turbo-progs
   (python-tkinter, python-imaging, python-imaging-tk, libjpeg-progs on older systems),
   and libimage-exiftool-perl.
 * Fedora: `dnf install python2-pillow  libjpeg-turbo-utils  pygtk2 pygtk2-libglade  ImageMagick  and perl-Image-ExifTool python3-pillow-tk`.

The specific external programs required are:
 * `jpegtran` to crop jpeg images (debian package: libjpeg-turbo-progs or libjpeg-progs)
 * `exiftool` to clear the EXIF rotation flag from jpeg output images (debian package: libimage-exiftool-perl)
 * `convert` to rotate and crop other image types (debian package: imagemagick or graphicsmagick-imagemagick-compat)
 * `magick` on Windows (download from ImageMagick and install)

## INSTALLATION

Although there are packages in the making, for a system-wide install, first make sure
prerequisites are met for your system and the &quot;flavor&quot; of cropgui you want to install.
For the GTK version, you may skip the TK dependencies. But make sure `jpegtran`, `exiftool`
and `convert` are installed.

Then do this on command line after cloning this repo:

    $ sudo bash ./install.sh -p /usr -P /usr/bin/python

Where the _-p_ flag tells install.sh to install to /usr instead of your home dir. And
flag _-P_ points to your python binary, which you can find via _$ type python_. You may
set the optional -f flag to switch between _tk_ and _gtk_ (the default) flavor of the app.

## Development status

The author (@jepler) is not actively developing this project.
Issues and pull requests are not likely to be acted on.
I would be interested in passing this project to a new maintainer.


## LICENSE
cropgui is available under the terms of the GNU GPL version 2 or later.
</pre>
        </div>
        </div>

</div>
</main>
</div>
</div>


</body>
</html>

