惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
Cyberwarzone
Cyberwarzone
L
LINUX DO - 最新话题
N
News and Events Feed by Topic
T
Troy Hunt's Blog
Help Net Security
Help Net Security
S
Security @ Cisco Blogs
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
M
MIT News - Artificial intelligence
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V2EX - 技术
V2EX - 技术
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
SegmentFault 最新的问题
I
InfoQ
H
Hacker News: Front Page
D
Docker
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
博客园 - 【当耐特】
T
Tor Project blog
U
Unit 42
H
Heimdal Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Privacy & Cybersecurity Law Blog
PCI Perspectives
PCI Perspectives
美团技术团队
O
OpenAI News
T
Tailwind CSS Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
GbyAI
GbyAI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MyScale Blog
MyScale Blog

Danb Blog

Cheaper Sodastream Gas with a Big Tank June 2026: What I've Been Working On · Danb Blog Running Snyk On Forgejo/Codeberg Actions · Danb Blog Tuta & Proton: An Open Source Client Does Not Result in an Open Source Service · Danb Blog May 2026: What I've Been Working On · Danb Blog 3D Printing Parts for my Greenhouse, Round 2 · Danb Blog Great Devices: Nexus 7 2013 · Danb Blog R36S Console RetroArch Stuck Menu Issue · Danb Blog April 2026: What I've Been Working On · Danb Blog Basic OpenCode Sandboxing with Docker · Danb Blog Games Played in 2025 · Danb Blog March 2026: What I've Been Working On · Danb Blog Shivam Mathur's "node-docker" Images are Awesome for PHP CI · Danb Blog February 2026: What I've Been Working On · Danb Blog Your BookStackApp project was assigned as a project for my Software Architecture course · Danb Blog My Sovol SV08 3D Printer Setup in 2026 · Danb Blog January 2026: What I've Been Working On · Danb Blog Epson Printer: The administrator password you entered was not recognized · Danb Blog Pressure to Follow Process · Danb Blog Online Shopping Email Notifications · Danb Blog My HomeLab Setup in 2026 · Danb Blog Linux Label Printing with the Phomemo D30 · Danb Blog Reporting to the CMA: Google Android Developer Verification · Danb Blog OPNsense & Dnsmasq: Responding with specific DNS servers · Danb Blog An Impromptu Introduction to ZFS Drive Replacement at 1am · Danb Blog Experience with UK Medical Cannabis for Ankylosing Spondylitis · Danb Blog Copyright Takedown for Linking to the "State of Open Source" Report · Danb Blog No, Gumroad Did Not Become Open Source Today · Danb Blog Scripting Monitors (KDE on Fedora) · Danb Blog Amber flags in Open Source & Self-Hosted Projects · Danb Blog LLMs are Directing Open Source Licensing · Danb Blog Games Played in 2024 · Danb Blog Beware of Poison in the Source · Danb Blog Common Misconceptions of the AGPL · Danb Blog Adapting GitHub action PHPUnit tests for Codeberg/Forgejo · Danb Blog Lessons from the Allotment · Danb Blog Futo, Please don't attempt to create your own Open Source Definition · Danb Blog Material You (Dynamic/Adaptive) Colors in Legacy Android Apps · Danb Blog Scripting Monitors (Gnome & Wayland on Fedora) · Danb Blog Retaining a Greenhouse Roof with 3d Printing · Danb Blog Games Played in 2023 · Danb Blog Lessons From Growing Food Indoors · Danb Blog Why the Distinction Between "Open Source" and "Source Available" is Important · Danb Blog Raspberry Pi Camera Module 3 Timelapse · Danb Blog Removing the Rear Seats on a Volvo C30 · Danb Blog Reporting Google's WEI to the CMA · Danb Blog Controlling Default GRUB Boot Option via USB · Danb Blog Creating a Video Home for FOSS Projects · Danb Blog Paying for Search · Danb Blog My Favourite Static Site Deploy Method · Danb Blog PhpStorm (JetBrains IDE) 2023 Linux Scaling · Danb Blog Synology Hibernation with Active Backup for Business and Tailscale · Danb Blog My 2023 HomeLab Setup · Danb Blog Redefining Open Source via "Commercial Open Source" · Danb Blog Moving to Mastodon · Danb Blog Gaining Sponsors · Danb Blog "This is a Low Maintenance Project" · Danb Blog Upgrading my CPU, Ryzen 2600 to 5800x · Danb Blog Scheduling Proxmox Storage to Reduce Disk Activity · Danb Blog Why the Term "Open Source" is Important · Danb Blog Lessons From Working for Myself (9 Months In) · Danb Blog Misrepresenting Open Source for Business Benefit · Danb Blog Cat Images in WebP · Danb Blog My 2022 Workstation Setup · Danb Blog Leaving my Job to Focus on Open Source (For a bit) · Danb Blog Quickly Getting Placeholder Images With Unsplash Source · Danb Blog A Thanks to Laravel for the LTS Releases · Danb Blog A Quick Overview of Unix-Style Permissions · Danb Blog The Power of currentColor · Danb Blog Dealing With Ankylosing Spondylitis Flareups · Danb Blog Hugo Verbose Dates With Suffixes · Danb Blog
Migrating Google Photos to my Personal NAS · Danb Blog
2022-10-07 · via Danb Blog

Recently I’ve been working to somewhat detach myself from Google services after seeing growing reported cases of users being suddenly locked out of their account without any possible recourse.

As part of this, I had about 5 year’s worth of photos stored solely within Google Photos that I wanted to migrate and organise within my personal NAS storage.

Initial Export

Grabbing all my Google Photos content was pretty easy. It was just a case of using Google Takeout to generate a bulk export. The export was split, in my case, across multiple .tgz files of a chosen 10GB size. I chose this instead of 50GB to keep download chunks a little more manageable in the event of connection failure during download.

Once my export was ready, a few hours after, I downloaded the archives, extracted them and combined them into a single folder to centralise things. One minor annoyance was the amount of duplicates due to the same file being stored across albums & other folders. I organised and de-duped everything into my own custom structure before cleaning up the files and compressing using the scripts below.

Cleaning Up JSON Files

The export will contain a lot of JSON files for album and photo metadata. I didn’t care about these at all so running the below from the root photo folder directory quickly took care of those:

find ./ -type f -name '*.json' -delete

“Edited” Image Versions

Many images had copies with -edited appended to their name. Some of these were my own edits via Google Photos, but many others I assumed to be auto-edits by Google Photos. Again, I didn’t care about these so a quick find command from the root photo folder got rid of them:

find ./ -type f -iname '*-edited.jpg' -delete

Compressing Images to WebP

The export resulted in many gigabytes of JPG images. Many of these were very high resolution and thus individually quite significant in size. I didn’t want to delete images, but at the same time, wanted to regain some space. I decided to compress down many old images to reasonable quality WebP images. To be space efficient I was using lossy WebP so I’d lose some image quality to achieve this but that was a trade-off I thought was fair to keep all images. For a select few important images, I set them aside and out of the scope of my compression commands.

These are the commands I used for this compression:

# Convert jpg images, within the current directory, over 1MB to WebP
# Requires parallel, imagemagick and find to be installed.
# Runs the compression across threads in parallel for maximum speed-up.
# WARNING: This compression is lossy (Quality will be lost).
find ./ -type f -iname '*.jpg' -size +1M -print0 | parallel -0 mogrify -format webp -quality 80 {}

# Find and delete the old jpg images we converted above
find ./ -type f -iname '*.jpg' -size +1M -delete

Just a consideration on using WebP, while generally quite well supported now their support is still not as universal on jpeg. I use WebP here since I’ve found the lossy compression format to produce less artifacts while allowing smaller file sizes.

You can play with the -quality 80 number to get the balance of quality/filesize you desire. I’d usually spot-check a few images before running the second delete command to ensure I was getting the right output. For some specific directories, with images of very little sentimental value, I’d lower this down to 60 for even better compression ratios.

Compressing MP4 Videos

My export contained many videos I had taken with my phone. Like with images, I wanted to keep these and was happy to compress, at a loss of quality, to retain them with a smaller filesize.

I did this with the following bash script:

# Find mp4 videos in the current directory and convert each via FFMPEG
# to lower quality mp4 videos.
# WARNING: This compression is lossy (Quality will be lost).
for filepath in ./*.mp4
do
filename=$(basename -s ".mp4" "$filepath")
echo $filename
ffmpeg -i "$filepath" -vcodec libx264 -crf 32 "cmp-$filename.mp4"
done

There’s no deletion of old videos in the above since I did that manually afterwards. I did play with newer video codecs (vp9, h265) but found the vastly slower encoding speed, to gain a better size/quality output, was not worth it for my use. I also roughly played with the -crf value in the above to land on 32 as the output quality I was happy with.

Future Photo Handling

While I’ve migrated my existing content from Google Photos, I’ll probably still continue to use it for temporary phone photo backup, since it’s proved pretty reliable and seamless for that use. Every so often, I’ll take the content and archive it within my NAS as I’ve done above for long-term safe-keeping.

A Note on Compression

As mentioned above, I’ve made heavy use of lossy compression for my content. When using lossy compression you need to be aware you’ll lose quality/data on each compression pass, so you’d only want to compress in this way once, or ideally not compress at all.

For me, I wanted the keep storage space reasonable. I had plenty of space on my NAS to store all original content, but my main concern was long-term backup storage, since I’d be syncing these files from my NAS to Backblaze B2.