Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
修复地球照片存放路径问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ambition_echo committed Jul 30, 2022
1 parent ad9d61a commit 44dbe1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions package/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ url="https://jihulab.com/ambition-echo/earth_wallpaper"
license=('GPL3')

depends=('qt5-base')
makedepends=('cmake' 'git' 'make')
makedepends=('cmake' 'git' 'ninja')

source=("git+$url.git")
sha256sums=("SKIP")
Expand All @@ -28,8 +28,8 @@ pkgver() {
build() {
mkdir build
cd build
cmake ../$resname
make
cmake ../$resname -G Ninja
ninja
}

package() {
Expand Down
17 changes: 9 additions & 8 deletions scripts/1.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def concat_images(image_names, name, path):
target.save(path + name, quality=100) # 成品图保存


def fill_img(path, name):
def fill_img(download_path, name):
global X, Y # 屏幕分辨率
global SIZE
height = int(1374.0 / (float(SIZE) * 0.01))
width = int(height * (float(X) / float(Y)))
img = Image.open(path + name)
img = Image.open(download_path + name)
new_img = Image.new(img.mode, (width, height), color='black')
new_img.paste(img, (int(width / 2 - 687), int(height / 2 - 687)))
today = datetime.datetime.utcnow()
Expand Down Expand Up @@ -73,13 +73,14 @@ def main():

url4 = f"http://rsapp.nsmc.org.cn/swapQuery/public/tileServer/getTile/fy-4a/full_disk/NatureColor/{path_today}00/jpg/1/1/1.png"

download(url1, path + '1' + name)
download(url2, path + '2' + name)
download(url3, path + '3' + name)
download(url4, path + '4' + name)
download(url1, "/tmp/" + '1' + name)
download(url2, "/tmp/" + '2' + name)
download(url3, "/tmp/" + '3' + name)
download(url4, "/tmp/" + '4' + name)

concat_images(['1' + name, '2' + name, '3' + name, '4' + name], name, path)
fill_img(path, name)
concat_images(['1' + name, '2' + name, '3' + name, '4' + name], name,
"/tmp/")
fill_img("/tmp/", name)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion src/trayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ void TrayIcon::saveCurrentImg()
QFile target = QFile("/tmp/earth-wallpaper/" + files[files.count() - 1]);
if (target.copy(picturePath + "/" + files[files.count() - 1]))
{
QMessageBox::information(nullptr, "保存", "保存成功!", QMessageBox::Yes);
QMessageBox::information(nullptr, "保存", "当前壁纸已保存到Picture目录", QMessageBox::Yes);
}
}

0 comments on commit 44dbe1d

Please sign in to comment.