Permalink
Switch branches/tags
Nothing to show
Commits on Jun 21, 2018
  1. pdAccelerator: add focus tracking to ensure modifer hotkey states...

    tannerhelland committed Jun 21, 2018
    ...are correctly captured when PD loses focus.  This is necessary to prevent system hotkeys like Alt+Tab from breaking PD's key state tracker.  (For example, re: Alt+Tab.  PD won't realize that the Alt key has been released, because it detected the Alt key being pressed, but then PD lost focus, which caused key tracking to be disabled - meaning we can't physically detect a subsequent Alt key release, at least until focus returns!)
    
    The new solution is to manually erase key state tracking when PD loses focus, and manually re-capture modifier keystate when PD gains focus.
    
    Many thanks to @jpbro for first reporting this issue.  See #267 for additional details and discussion.
    
    (Also, this fixes #267)
Commits on Jun 19, 2018
  1. Implement Tools > Create macro > From session history menu

    tannerhelland committed Jun 19, 2018
    Relates to #265.
    
    This is my first take on @jpbro's suggestion for an "apply history to some other image" feature.  I've placed it in a new Tools > Create Macro menu (alongside macro recording) as that seemed most intuitive to me, but I am open to feedback/other suggestions!
    
    The code was quick to piece together as it borrows liberally from the Undo History window.  Two listboxes are provided: one for the user to select a "first action" from the current session's history, and another to select the "last action".  All actions between "first" and "last" (inclusive) are then auto-converted to PD's macro format and handed off to the macro engine.
    
    In a rare bit of proper code reuse, the existing Macro engine has been reworked to accept external action lists, which it then writes using the same exporter as recorded macros.  I've used this to verify that whether recording a macro, or exporting it retroactively via this new tool, the resulting macro file is byte-for-byte identical.
    
    I wouldn't be surprised if many people actually prefer this tool to the old method of recording macros, as this plays much better with the typical "experimenting as you go" approach to photo editing.
    
    Many thanks to @jpbro for this suggestion.  I'm going to leave #265 open for a bit longer (pending feedback and some additional testing) but hopefully the bulk of the work is ready for end users.
Commits on Jun 18, 2018
  1. Undo engine: record all user behavior in macro-compatible format

    tannerhelland committed Jun 18, 2018
    Relates to #265.  Thank you to @jpbro for pointing me down this path.
    
    In the past, PD's Undo engine only stored a subset of information that the Macro engine stores.  (For example, Undo tracks operation names, so it can display them in the Undo History browser, but it doesn't track other action attributes, like "is a dialog associated with this action?")
    
    As of this commit, this is no longer the case.  PD's Undo engine now tracks user operations in a manner very similar to the Macro engine.  This actually results in cleaner code in many places (because we can pass around bare PD_ProcessCall structs instead of manually stripping out individual elements), and it's a prerequisite to creating macro data from arbitrary points in a given editing session.
    
    While I was here, I also caught and fixed a few minor bugs...
    - The "Modify selection" Undo menu text - used when the user makes a non-destructive setting change via something other than the canvas, e.g. toggling a selection tool dropdown - was not being captured by the translation engine.
    - Rectangular selections *without* feathering were sometimes creating two Undo stack entries instead of one, because selection dimensions were being cast to integer in some places but not others.  (So one action was being created for the floating-point coords, and a second one for the integer coords - ugh!)
    
    This overhaul required some fairly deep changes to the Undo/Redo engine tracks data, so please let me know if you run into any unexpected behavior.
  2. pdSpinner: manually yield for mouse events during press+hold input

    tannerhelland committed Jun 18, 2018
    Relates to #266.  Thank you to @Alric-Rahl for reporting.
  3. Update gitignore

    tannerhelland committed Jun 18, 2018
  4. Remove Git LFS support; rewrite history (again)

    tannerhelland committed Jun 18, 2018
    Apologies for any trouble this causes with forks, but Git LFS has proven to be an endless source of headaches.  Its integration with GitHub is remarkably poor (e.g. "Download as Zip" permanently breaks, commit titles get converted to descriptions, it is impossible to ever *remove* blobs from LFS storage), and the stringent bandwidth and space requirements are going to *cost* me money in the long run.  Long story short, if you're going to make the painful decision to forcibly rewrite your git history, there are better (and cheaper) ways to reduce repo space.
    
    As such, I'm reverting to a repo copy prior to the Git LFS conversion, then re-applying all subsequent commits in a single "giant" commit.  I realize this is inelegant but I don't know a better way to do it.
    
    Commits included here:
    - create proper issue templates
    - convert various in-app and documentation links to the new https version of photodemon.org
    - new update patcher built around a dedicated GH-pages site (instead of relying on raw binary blobs inside a repo)
    - new builds of some 3rd-party plugins
Commits on Jun 1, 2018
  1. Round-rectangle selection tool: fix behavior at small sizes

    tannerhelland committed Jun 1, 2018
    It's possible that other selection tools needs a similar fix - I'll investigate those soon.
Commits on May 31, 2018
  1. Image importer: overhaul TIFF loading

    tannerhelland committed May 31, 2018
    TIFFs are a nightmare in many different ways, and unfortunately for us, FreeImage is prone to a ton of weird issues with 'em.  I don't know if I should blame FreeImage or libTiff for this (or the TIFF spec/lack-of-spec in general), but since multipage TIFFs are currently our only real mechanism for multi-layer interop with other software, I need to improve stability.
    
    I've now rewritten PD's GDI+ loader to support multi-page parsing, with full support for things like per-page color-management, orientation flags, and CMYK handling.  GDI+ (at least on Win 10) has proven to be far more reliable *and* fast at handling TIFF data, so it's wins all around.
    
    Because of this, I've also rewritten PD's TIFF import strategy to first attempt loading via GDI+, and if that fails, fall back to FreeImage.  On XP, this is useful as GDI+ was underdeveloped back then.  It also gives us twice the coverage of esoteric TIFF formats, which is more than most software offers.
    
    A lot of files were touched as part of this rewrite, but the new GDI+ loader is much cleaner (even for other file formats), so I think it's a win all-around.
    
    As part of the work, I stripped out a bunch of superfluous translation segments, and consolidated some overwrought GDI+ interface bits.
  2. GDI+: new interface for property retrieval, prep for multipage support

    tannerhelland committed May 31, 2018
    FreeImage is finicky with multipage images, and sometimes it fails for unknown reasons.  As I move more and more away from it, it'd be nice to have a GDI+ fallback for multipage TIFF files as that's currently our only real layer-friendly mechanism for interop with other software.
    
    In this commit, the GDI+ load function has been reworked against proper property retrieval (our old interface was hackish and bad), and multipage TIFFs are now correctly identified and reported back to the calling function.  Actual implementation of multipage > layer conversion is still TODO
  3. Automatic updates: switch to Git-LFS-compatible download strategy

    tannerhelland committed May 31, 2018
    I wish I'd known about this option earlier.  Instead of hard-coding a link to the raw update data, I now link using the "?raw=true" parameter.  GitHub will automatically redirect that to the actual update file, wherever it may reside.
    
    This should significantly improve update download speeds for most users.
Commits on May 30, 2018
  1. ExifTool interface: rewrite against pdString

    tannerhelland committed May 30, 2018
    ExifTool interop requires a ton of line-delimited strings to be passed back and forth over stdin/out.  We were previously creating these as huge code blocks like:
    
    cmdParams = cmdParams & "some-variable" & vbCrLf
    
    pdString's StringBuilder implementation makes this much faster, and much less thrashy for the BSTR table.
  2. Updated German language file

    tannerhelland committed May 30, 2018
    Many thanks to Roy K for his ongoing work
  3. Updated Traditional Chinese translation

    tannerhelland committed May 30, 2018
    c/o Chiahong.  Thank you!
Commits on May 29, 2018
  1. Image > Metadata viewer: add buttons for copying metadata to clipboard

    tannerhelland committed May 29, 2018
    This is helpful when debugging image-specific issues.  For list-type settings (like many EXIF settings), there was no way for the user to send me specific data besides annoyances like screenshots.
  2. Greatly simplify cursor handling

    tannerhelland committed May 29, 2018
    Back when PD was using a horrifying mix of built-in VB UI elements and custom UI elements, we had to play nasty games with class cursor settings to prevent VB from forcibly changing the cursor back to whatever the design-time property dictated.  Now that we're free of that debacle, we can rely on standard WM_SETCURSOR messages.
Commits on May 22, 2018
  1. pdRuler: proper fix for vertical font rendering across Windows versions

    tannerhelland committed May 22, 2018
    Turns out Windows 7 has totally different vertical font rendering behavior, too - thanks to contributor shishi for reporting this to me, and thanks to Microsoft for making this so much harder than it needs to be!  /s
    
    I now have to make various run-time font rendering decisions based on the current OS - and on Windows 7, I have to do this even though the OS supplies a vertically optimized font.  I'm honestly not 100% sure what is going on under the hood here, because Win 7 and Win 10 should render similarly... but that's life as a Windows developer, I guess.  (sigh)
Commits on May 17, 2018
  1. Remove special checks for FreeImage DPI retrieval

    tannerhelland committed May 17, 2018
    These caused as many problems as they solved.  Now, we just take whatever FreeImage hands us, and if ExifTool detects something different, we use its values instead.
Commits on May 11, 2018
  1. fix minor leak in zstd wrapper

    tannerhelland committed May 11, 2018
    asinine typo on my part (freeing handles in the wrong order, ugh)
Commits on May 7, 2018
  1. Effect previews: performance enhancements while selections are active

    tannerhelland committed May 7, 2018
    FYI, this may be my last commit for awhile.  I am currently in the process of rebuilding photodemon.org and migrating it to a new hosting solution, and that will be my focus for the next little while
Commits on May 6, 2018
  1. Faster effect previews when a selection is active

    tannerhelland committed May 6, 2018
    Effect previews in general are due for an overhaul (as required for #252, for example), but in the meantime, I may as well clean-up a few items.
    
    For example, selection effect rendering can be improved by caching a relevant copy of the selection mask pre-sized to match the preview area.  This saves a meaningful amount of time when the image and/or selection is large, and it'll be very helpful for generating a real-time preview gallery.
Commits on May 4, 2018
  1. pdCheckbox: convert .Value property to Bool...

    tannerhelland committed May 4, 2018
    ...instead of the horrible old three-state constants.  PD never uses "indeterminate" values, and a *ton* of useless glue was required to map between booleans and those damn three-state values.
    
    This change touches a lot of files - sorry about that - but it reduces .exe size and makes things *much* more readable.  (I'm way past the days of trying to match common control behavior, anyway, so this was long overdue!)
  2. Consolidate various memory-related APIs

    Tanner
    Tanner committed May 4, 2018
    These APIs were previously declared in dozens of places throughout the project, which led to a bunch of differing declaration details.  I keep getting bitten by subtle changes (e.g. params ByRef in one place, ByVal in another), and given how frequently I use these, I need to consolidate and unify them to reduce the potential for stupid mistakes.
    
    Thanks also to Roy K for his vigilance in keeping the German translation up-to-date!
  3. LittleCMS: patch issue with swapped endian alpha channels

    Tanner
    Tanner committed May 4, 2018
    Details in the code, but basically this lets me avoid manual alpha channel copying when downsamping 16-bpc PNG data to 8-bpc.
Commits on May 3, 2018
  1. Resize tools, rulers: add support for points, picas

    Tanner
    Tanner committed May 3, 2018
    May as well knock these out while I'm here.  This brings us to near-parity with Photoshop and various open-source photo editors.
  2. GDI+: debug function for listing installed decoders

    Tanner
    Tanner committed May 3, 2018
    This was a quick check to see if the latest Windows 10 SDK improvements (including new HEIF support) have been backported to GDI+; alas, that doesn't appear to be the case.
  3. Rectangle/Ellipse selection tools: width/height/aspect-ratio can now …

    Tanner
    Tanner committed May 3, 2018
    …be locked
    
    I've been staring at this code for several days now (amidst resurrecting a failed HDD on my primary development PC, ugh) and I *think* it's working well, but there are a ton of corner cases and I may not have tested everything to perfection.  I'm going to let this simmer for a few days before doing another round of testing, but perhaps others can also catch problems I may have missed.
    
    The selection tool UI for rectangle and elliptical selections was already dense, so I had to rework it a bit to provide additional space for aspect ratio editing and locking/unlocking.  I hope the new arrangement is intuitive.
    
    Only one attribute (width/height/aspect ratio) can be locked at a time.  This restriction should be self-explanatory - if you lock any two parameters, the third becomes locked by default, which isn't exactly helpful.  The UI handles various restrictions automatically.
    
    "Locking" a given value allows you to enforce it while still modifying other values.  For example, you can create a selection, then set its aspect ratio to "16:9" using the new aspect ratio spinners.  If you then lock the aspect ratio (using the cute little lock button), you can continue to modify the selection's width and height - and the 16:9 aspect ratio will be automatically applied to your changes.
    
    Lock settings are enforced whether you modify a selection via mouse+canvas or keyboard+edit boxes.  Locked settings are also applied to *new* selections - for example, if you lock in a "16:9" aspect ratio, then click-drag to create a new selection, the new selection will be forced to a 16:9 aspect ratio regardless of size.
    
    This has been a long-standing request from many users, so apologies for taking so long to implement it.
  4. pdSpinner control: allow "reset button" hiding

    Tanner
    Tanner committed May 3, 2018
    For some controls, there's no obvious Default Value - e.g. what value should the the selection "left"/"top" spinners reset to?  In cases like this, I'd prefer to let the UI breathe a little, and a new property allows me to hide spinner reset button in instances where it's not relevant/useful.
  5. PDMath: switch to a much simpler float -> fraction calculator

    Tanner
    Tanner committed May 3, 2018
    The old one was error-prone and poorly tested; the new one is simple and conceptually straightforward.
    
    The "pdResize" control used by various size-related dialogs have been updated to use the new formula.  This should make aspect ratio calculations more predictable and useful.
  6. Test commit from new GitHub Desktop

    Tanner
    Tanner committed May 3, 2018