https://git.reactos.org/?p=reactos.git;a=commitdiff;h=084fae1eb480ac9ee4d36…
commit 084fae1eb480ac9ee4d360708e0b74ec16e44a6d
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Dec 19 13:22:53 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Dec 19 13:22:53 2023 +0900
[SHIMGVW] Add 'rotate and save image' buttons (#6186)
- Add IDC_ROT_CWSAVE and IDC_ROT_CCWSAVE buttons.
- Add Preview_pSaveImage helper function.
- Use it in IDC_ROT_CWSAVE and IDC_ROT_CCWSAVE
command handling.
CORE-19358, CORE-19387
---
dll/win32/shimgvw/lang/bg-BG.rc | 2 +
dll/win32/shimgvw/lang/cs-CZ.rc | 2 +
dll/win32/shimgvw/lang/de-DE.rc | 2 +
dll/win32/shimgvw/lang/en-US.rc | 2 +
dll/win32/shimgvw/lang/es-ES.rc | 2 +
dll/win32/shimgvw/lang/fr-FR.rc | 2 +
dll/win32/shimgvw/lang/he-IL.rc | 2 +
dll/win32/shimgvw/lang/it-IT.rc | 2 +
dll/win32/shimgvw/lang/ja-JP.rc | 2 +
dll/win32/shimgvw/lang/lt-LT.rc | 2 +
dll/win32/shimgvw/lang/no-NO.rc | 2 +
dll/win32/shimgvw/lang/pl-PL.rc | 2 +
dll/win32/shimgvw/lang/pt-PT.rc | 2 +
dll/win32/shimgvw/lang/ro-RO.rc | 2 +
dll/win32/shimgvw/lang/ru-RU.rc | 2 +
dll/win32/shimgvw/lang/sk-SK.rc | 2 +
dll/win32/shimgvw/lang/sq-AL.rc | 2 +
dll/win32/shimgvw/lang/tr-TR.rc | 2 +
dll/win32/shimgvw/lang/uk-UA.rc | 2 +
dll/win32/shimgvw/lang/zh-CN.rc | 2 +
dll/win32/shimgvw/lang/zh-HK.rc | 2 +
dll/win32/shimgvw/lang/zh-TW.rc | 2 +
dll/win32/shimgvw/res/rot1save.bmp | Bin 0 -> 822 bytes
dll/win32/shimgvw/res/rot2save.bmp | Bin 0 -> 822 bytes
dll/win32/shimgvw/resource.h | 40 +++++++------
dll/win32/shimgvw/shimgvw.c | 115 +++++++++++++++++++++++++++++--------
dll/win32/shimgvw/shimgvw.rc | 2 +
27 files changed, 162 insertions(+), 39 deletions(-)
diff --git a/dll/win32/shimgvw/lang/bg-BG.rc b/dll/win32/shimgvw/lang/bg-BG.rc
index 279db8f0148..871a1f1140d 100644
--- a/dll/win32/shimgvw/lang/bg-BG.rc
+++ b/dll/win32/shimgvw/lang/bg-BG.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Намаляване (-)"
IDS_TOOLTIP_ROT_CLOCKW "Завъртане по часовника (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Завъртане срещу часовника (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Разпечатване (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Записване като... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/cs-CZ.rc b/dll/win32/shimgvw/lang/cs-CZ.rc
index 4a4c67ab0e7..a8dd4804e63 100644
--- a/dll/win32/shimgvw/lang/cs-CZ.rc
+++ b/dll/win32/shimgvw/lang/cs-CZ.rc
@@ -21,6 +21,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Oddálit (-)"
IDS_TOOLTIP_ROT_CLOCKW "Otočit po směru hodinových ručiček (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Otočit proti směru hodinových ručiček (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Odstranit (DEL)"
IDS_TOOLTIP_PRINT "Tisk (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Uložit jako... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/de-DE.rc b/dll/win32/shimgvw/lang/de-DE.rc
index 59215804a46..359029da600 100644
--- a/dll/win32/shimgvw/lang/de-DE.rc
+++ b/dll/win32/shimgvw/lang/de-DE.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Verkleinern (-)"
IDS_TOOLTIP_ROT_CLOCKW "Drehen im Uhrzeigersinn (Strg+K)"
IDS_TOOLTIP_ROT_COUNCW "Drehen gegen den Uhrzeigersinn (Strg+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Löschen (Entf)"
IDS_TOOLTIP_PRINT "Drucken (Strg+P)"
IDS_TOOLTIP_SAVEAS "Speichern unter... (Strg+S)"
diff --git a/dll/win32/shimgvw/lang/en-US.rc b/dll/win32/shimgvw/lang/en-US.rc
index d2712a552da..ff2d63091b8 100644
--- a/dll/win32/shimgvw/lang/en-US.rc
+++ b/dll/win32/shimgvw/lang/en-US.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Zoom Out (-)"
IDS_TOOLTIP_ROT_CLOCKW "Rotate Clockwise (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Rotate Counterclockwise (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Print (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Save As... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/es-ES.rc b/dll/win32/shimgvw/lang/es-ES.rc
index 08bc0059e85..ebaad903bd7 100644
--- a/dll/win32/shimgvw/lang/es-ES.rc
+++ b/dll/win32/shimgvw/lang/es-ES.rc
@@ -18,6 +18,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Alejar (-)"
IDS_TOOLTIP_ROT_CLOCKW "Rotar en el sentido de las agujas del reloj
(Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Rotar en el sentido opuesto a las agujas del reloj
(Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Imprimir (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Guardar como... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/fr-FR.rc b/dll/win32/shimgvw/lang/fr-FR.rc
index d6fcf5fb11e..26bf2eaab06 100644
--- a/dll/win32/shimgvw/lang/fr-FR.rc
+++ b/dll/win32/shimgvw/lang/fr-FR.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Diminuer (-)"
IDS_TOOLTIP_ROT_CLOCKW "Tourner dans le sens des aiguilles d'une montre
(Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Tourner dans le sens opposé des aiguilles d'une
montre (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Supprimer (Suppr)"
IDS_TOOLTIP_PRINT "Imprimer (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Enregistrer sous... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/he-IL.rc b/dll/win32/shimgvw/lang/he-IL.rc
index 6d000b52fb0..5952655ad71 100644
--- a/dll/win32/shimgvw/lang/he-IL.rc
+++ b/dll/win32/shimgvw/lang/he-IL.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "הרחקה (-)"
IDS_TOOLTIP_ROT_CLOCKW "סובב עם כיוון השעון (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "סובב כנגד כיוון השעון (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "הדפס (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "שמירה בשם... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/it-IT.rc b/dll/win32/shimgvw/lang/it-IT.rc
index 6b7f5af5289..fba8f6d3d97 100644
--- a/dll/win32/shimgvw/lang/it-IT.rc
+++ b/dll/win32/shimgvw/lang/it-IT.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Riduci (-)"
IDS_TOOLTIP_ROT_CLOCKW "Ruota in senso orario (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Ruota in senso antiorario (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Elimina (CANC)"
IDS_TOOLTIP_PRINT "Stampa (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Salva come... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/ja-JP.rc b/dll/win32/shimgvw/lang/ja-JP.rc
index 5f3cd2dbc45..c8140066311 100644
--- a/dll/win32/shimgvw/lang/ja-JP.rc
+++ b/dll/win32/shimgvw/lang/ja-JP.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "ズームアウト (-)"
IDS_TOOLTIP_ROT_CLOCKW "時計回りに回転 (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "反時計回りに回転 (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "印刷 (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "名前を付けて保存... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/lt-LT.rc b/dll/win32/shimgvw/lang/lt-LT.rc
index b4ab0c2729d..fa496a2f53e 100644
--- a/dll/win32/shimgvw/lang/lt-LT.rc
+++ b/dll/win32/shimgvw/lang/lt-LT.rc
@@ -18,6 +18,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Mažinti (-)"
IDS_TOOLTIP_ROT_CLOCKW "Pasukti pagal laikrodžio rodyklę (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Pasukti prieš laikrodžio rodyklę (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Spausdinti (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Įrašyti kaip... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/no-NO.rc b/dll/win32/shimgvw/lang/no-NO.rc
index 233b27bffb3..5b321da2dac 100644
--- a/dll/win32/shimgvw/lang/no-NO.rc
+++ b/dll/win32/shimgvw/lang/no-NO.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Forminske (-)"
IDS_TOOLTIP_ROT_CLOCKW "Med urviseren (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Dreie mot urviseren (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Skriv ut (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Lagre som... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/pl-PL.rc b/dll/win32/shimgvw/lang/pl-PL.rc
index d8ed33829b5..a68329e9a90 100644
--- a/dll/win32/shimgvw/lang/pl-PL.rc
+++ b/dll/win32/shimgvw/lang/pl-PL.rc
@@ -21,6 +21,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Pomniejsz (-)"
IDS_TOOLTIP_ROT_CLOCKW "Obróć zgodnie z ruchem wskazówek zegara (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Obróć przeciwnie do ruchu wskazówek zegara
(Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Usuń (Delete)"
IDS_TOOLTIP_PRINT "Drukuj (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Zapisz jako... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/pt-PT.rc b/dll/win32/shimgvw/lang/pt-PT.rc
index 0d4b4b9fa4a..d51396c5018 100644
--- a/dll/win32/shimgvw/lang/pt-PT.rc
+++ b/dll/win32/shimgvw/lang/pt-PT.rc
@@ -21,6 +21,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Zoom (-)"
IDS_TOOLTIP_ROT_CLOCKW "Girar no sentido dos ponteiros do
relógio(Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Girar no sentido anti-horário (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Imprimir (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Guardar como... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/ro-RO.rc b/dll/win32/shimgvw/lang/ro-RO.rc
index 1cd6f1e2301..42efd6c54d0 100644
--- a/dll/win32/shimgvw/lang/ro-RO.rc
+++ b/dll/win32/shimgvw/lang/ro-RO.rc
@@ -24,6 +24,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Micșorare (-)"
IDS_TOOLTIP_ROT_CLOCKW "Rotește în sens orar (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Rotește în sens antiorar (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Șterge (DEL)"
IDS_TOOLTIP_PRINT "Imprimă (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Salvează ca… (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/ru-RU.rc b/dll/win32/shimgvw/lang/ru-RU.rc
index 05fe4508973..2b42a6f364e 100644
--- a/dll/win32/shimgvw/lang/ru-RU.rc
+++ b/dll/win32/shimgvw/lang/ru-RU.rc
@@ -16,6 +16,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Уменьшить (-)"
IDS_TOOLTIP_ROT_CLOCKW "Повернуть по часовой стрелке (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Повернуть против часовой стрелки (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Печать (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Сохранить как... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/sk-SK.rc b/dll/win32/shimgvw/lang/sk-SK.rc
index 8c802a0da57..d3948c52b54 100644
--- a/dll/win32/shimgvw/lang/sk-SK.rc
+++ b/dll/win32/shimgvw/lang/sk-SK.rc
@@ -20,6 +20,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Vzdialiť (-)"
IDS_TOOLTIP_ROT_CLOCKW "Otočiť v smere hodinových ručičiek (Ctrl+K)" //
Otočiť vpravo
IDS_TOOLTIP_ROT_COUNCW "Otočiť proti smeru hodinových ručičiek (Ctrl+L)" //
Otočiť vľavo
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Vytlačiť (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Uložiť ako... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/sq-AL.rc b/dll/win32/shimgvw/lang/sq-AL.rc
index 4bb22218a2b..c04f9bf07ca 100644
--- a/dll/win32/shimgvw/lang/sq-AL.rc
+++ b/dll/win32/shimgvw/lang/sq-AL.rc
@@ -20,6 +20,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Zoom Jashtë (-)"
IDS_TOOLTIP_ROT_CLOCKW "Rrotullo KrahAkrepave (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Rrotullo kundërKrahAkrepave (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Printo (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Ruaj Si... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/tr-TR.rc b/dll/win32/shimgvw/lang/tr-TR.rc
index 3f0cbc238df..ee2f2c1b629 100644
--- a/dll/win32/shimgvw/lang/tr-TR.rc
+++ b/dll/win32/shimgvw/lang/tr-TR.rc
@@ -18,6 +18,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Uzaklaştır (-)"
IDS_TOOLTIP_ROT_CLOCKW "Saat Yönünde Döndür (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Saat Yönünün Tersi Yönünde Döndür (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Sil (DEL)"
IDS_TOOLTIP_PRINT "Yazdır (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Farklı Kaydet... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/uk-UA.rc b/dll/win32/shimgvw/lang/uk-UA.rc
index cfce26019ab..ebe569ba7ca 100644
--- a/dll/win32/shimgvw/lang/uk-UA.rc
+++ b/dll/win32/shimgvw/lang/uk-UA.rc
@@ -24,6 +24,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "Зменшити (-)"
IDS_TOOLTIP_ROT_CLOCKW "Повернути за годинниковою стрілкою (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Повернути проти годинникової стрілки (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "Delete (DEL)"
IDS_TOOLTIP_PRINT "Друк (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Зберегти як... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/zh-CN.rc b/dll/win32/shimgvw/lang/zh-CN.rc
index a988f7a17c4..632673d5a3a 100644
--- a/dll/win32/shimgvw/lang/zh-CN.rc
+++ b/dll/win32/shimgvw/lang/zh-CN.rc
@@ -25,6 +25,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "缩小 (-)"
IDS_TOOLTIP_ROT_CLOCKW "顺时针旋转 (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "逆时针旋转 (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "删除 (DEL)"
IDS_TOOLTIP_PRINT "打印 (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "另存为...(Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/zh-HK.rc b/dll/win32/shimgvw/lang/zh-HK.rc
index c0ecabe2b7e..17ff1b7d87f 100644
--- a/dll/win32/shimgvw/lang/zh-HK.rc
+++ b/dll/win32/shimgvw/lang/zh-HK.rc
@@ -24,6 +24,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "縮小 (-)"
IDS_TOOLTIP_ROT_CLOCKW "順時針旋轉 (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "逆時針旋轉 (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "刪除 (DEL)"
IDS_TOOLTIP_PRINT "列印 (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "另存新檔... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/lang/zh-TW.rc b/dll/win32/shimgvw/lang/zh-TW.rc
index 7b1e05ad0a5..98f820e674d 100644
--- a/dll/win32/shimgvw/lang/zh-TW.rc
+++ b/dll/win32/shimgvw/lang/zh-TW.rc
@@ -24,6 +24,8 @@ BEGIN
IDS_TOOLTIP_ZOOM_OUT "縮小 (-)"
IDS_TOOLTIP_ROT_CLOCKW "順時針旋轉 (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "逆時針旋轉 (Ctrl+L)"
+ IDS_TOOLTIP_ROT_CWSAVE "Rotate Clockwise and Save (Lossy)"
+ IDS_TOOLTIP_ROT_CCWSAVE "Rotate Counterclockwise and Save (Lossy)"
IDS_TOOLTIP_DELETE "刪除 (DEL)"
IDS_TOOLTIP_PRINT "列印 (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "另存新檔... (Ctrl+S)"
diff --git a/dll/win32/shimgvw/res/rot1save.bmp b/dll/win32/shimgvw/res/rot1save.bmp
new file mode 100644
index 00000000000..cca0a4bbf83
Binary files /dev/null and b/dll/win32/shimgvw/res/rot1save.bmp differ
diff --git a/dll/win32/shimgvw/res/rot2save.bmp b/dll/win32/shimgvw/res/rot2save.bmp
new file mode 100644
index 00000000000..efdd3209850
Binary files /dev/null and b/dll/win32/shimgvw/res/rot2save.bmp differ
diff --git a/dll/win32/shimgvw/resource.h b/dll/win32/shimgvw/resource.h
index 96da8e444cf..ec2fbf116bd 100644
--- a/dll/win32/shimgvw/resource.h
+++ b/dll/win32/shimgvw/resource.h
@@ -20,11 +20,13 @@
#define IDB_ZOOM_OUT 56
#define IDB_ROT_CLOCKW 57
#define IDB_ROT_COUNCW 58
-#define IDB_DELETE 59
-#define IDB_PRINT 60
-#define IDB_SAVEAS 61
-#define IDB_MODIFY 62
-#define IDB_HELP_TOC 63
+#define IDB_ROT_CWSAVE 59
+#define IDB_ROT_CCWSAVE 60
+#define IDB_DELETE 61
+#define IDB_PRINT 62
+#define IDB_SAVEAS 63
+#define IDB_MODIFY 64
+#define IDB_HELP_TOC 65
/* ToolBar buttons */
#define IDC_TOOL_BASE 500
@@ -38,12 +40,14 @@
#define IDC_ZOOM_OUT (IDC_TOOL_BASE + 6)
#define IDC_ROT_CLOCKW (IDC_TOOL_BASE + 7)
#define IDC_ROT_COUNCW (IDC_TOOL_BASE + 8)
-#define IDC_DELETE (IDC_TOOL_BASE + 9)
-#define IDC_PRINT (IDC_TOOL_BASE + 10)
-#define IDC_SAVEAS (IDC_TOOL_BASE + 11)
-#define IDC_MODIFY (IDC_TOOL_BASE + 12)
-#define IDC_HELP_TOC (IDC_TOOL_BASE + 13)
-#define IDC_ENDSLIDESHOW (IDC_TOOL_BASE + 14)
+#define IDC_ROT_CWSAVE (IDC_TOOL_BASE + 9)
+#define IDC_ROT_CCWSAVE (IDC_TOOL_BASE + 10)
+#define IDC_DELETE (IDC_TOOL_BASE + 11)
+#define IDC_PRINT (IDC_TOOL_BASE + 12)
+#define IDC_SAVEAS (IDC_TOOL_BASE + 13)
+#define IDC_MODIFY (IDC_TOOL_BASE + 14)
+#define IDC_HELP_TOC (IDC_TOOL_BASE + 15)
+#define IDC_ENDSLIDESHOW (IDC_TOOL_BASE + 16)
#define TBICON_PREV_PIC 0
#define TBICON_NEXT_PIC 1
@@ -54,11 +58,13 @@
#define TBICON_ZOOM_OUT 6
#define TBICON_ROT_CLOCKW 7
#define TBICON_ROT_COUNCW 8
-#define TBICON_DELETE 9
-#define TBICON_PRINT 10
-#define TBICON_SAVEAS 11
-#define TBICON_MODIFY 12
-#define TBICON_HELP_TOC 13
+#define TBICON_ROT_CWSAVE 9
+#define TBICON_ROT_CCWSAVE 10
+#define TBICON_DELETE 11
+#define TBICON_PRINT 12
+#define TBICON_SAVEAS 13
+#define TBICON_MODIFY 14
+#define TBICON_HELP_TOC 15
/* Strings */
#define IDS_APPTITLE 100
@@ -90,6 +96,8 @@
#define IDS_TOOLTIP_SAVEAS 411
#define IDS_TOOLTIP_MODIFY 412
#define IDS_TOOLTIP_HELP_TOC 413
+#define IDS_TOOLTIP_ROT_CWSAVE 414
+#define IDS_TOOLTIP_ROT_CCWSAVE 415
/* Keyboard accelerators */
#define IDR_ACCELERATOR 600
diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index 7cedfc1afde..693b499761f 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -59,6 +59,9 @@ static const TBBUTTON s_Buttons[] =
DEFINE_BTN_INFO(ROT_CLOCKW),
DEFINE_BTN_INFO(ROT_COUNCW),
DEFINE_BTN_SEPARATOR,
+ DEFINE_BTN_INFO(ROT_CWSAVE),
+ DEFINE_BTN_INFO(ROT_CCWSAVE),
+ DEFINE_BTN_SEPARATOR,
DEFINE_BTN_INFO(DELETE),
DEFINE_BTN_INFO(PRINT),
DEFINE_BTN_INFO(SAVEAS),
@@ -87,11 +90,13 @@ static const TB_BUTTON_CONFIG s_ButtonConfig[] =
DEFINE_BTN_CONFIG(ZOOM_OUT),
DEFINE_BTN_CONFIG(ROT_CLOCKW),
DEFINE_BTN_CONFIG(ROT_COUNCW),
+ DEFINE_BTN_CONFIG(ROT_CWSAVE),
+ DEFINE_BTN_CONFIG(ROT_CCWSAVE),
DEFINE_BTN_CONFIG(DELETE),
DEFINE_BTN_CONFIG(PRINT),
DEFINE_BTN_CONFIG(SAVEAS),
DEFINE_BTN_CONFIG(MODIFY),
- DEFINE_BTN_CONFIG(HELP_TOC)
+ DEFINE_BTN_CONFIG(HELP_TOC),
};
typedef struct tagPREVIEW_DATA
@@ -106,6 +111,7 @@ typedef struct tagPREVIEW_DATA
UINT m_nMouseDownMsg;
POINT m_ptOrigin;
IStream *m_pMemStream;
+ WCHAR m_szFile[MAX_PATH];
} PREVIEW_DATA, *PPREVIEW_DATA;
static inline PPREVIEW_DATA
@@ -344,6 +350,8 @@ Preview_pFreeImage(PPREVIEW_DATA pData)
pData->m_pMemStream->lpVtbl->Release(pData->m_pMemStream);
pData->m_pMemStream = NULL;
}
+
+ pData->m_szFile[0] = UNICODE_NULL;
}
IStream* MemStreamFromFile(LPCWSTR pszFileName)
@@ -384,14 +392,6 @@ Preview_pLoadImage(PPREVIEW_DATA pData, LPCWSTR szOpenFileName)
{
Preview_pFreeImage(pData);
- /* check file presence */
- if (!szOpenFileName || GetFileAttributesW(szOpenFileName) == 0xFFFFFFFF)
- {
- DPRINT1("File %s not found!\n", szOpenFileName);
- Preview_UpdateTitle(pData, NULL);
- return;
- }
-
pData->m_pMemStream = MemStreamFromFile(szOpenFileName);
if (!pData->m_pMemStream)
{
@@ -413,8 +413,8 @@ Preview_pLoadImage(PPREVIEW_DATA pData, LPCWSTR szOpenFileName)
Anime_LoadInfo(&pData->m_Anime);
- if (szOpenFileName && szOpenFileName[0])
- SHAddToRecentDocs(SHARD_PATHW, szOpenFileName);
+ SHAddToRecentDocs(SHARD_PATHW, szOpenFileName);
+ GetFullPathNameW(szOpenFileName, _countof(pData->m_szFile), pData->m_szFile,
NULL);
/* Reset zoom and redraw display */
Preview_ResetZoom(pData);
@@ -428,6 +428,53 @@ Preview_pLoadImageFromNode(PPREVIEW_DATA pData, SHIMGVW_FILENODE
*pNode)
Preview_pLoadImage(pData, (pNode ? pNode->FileName : NULL));
}
+static BOOL
+Preview_pSaveImage(PPREVIEW_DATA pData, LPCWSTR pszFile)
+{
+ ImageCodecInfo *codecInfo;
+ GUID rawFormat;
+ UINT j, num, nFilterIndex, size;
+ BOOL ret = FALSE;
+
+ if (g_pImage == NULL)
+ return FALSE;
+
+ GdipGetImageEncodersSize(&num, &size);
+ codecInfo = QuickAlloc(size, FALSE);
+ if (!codecInfo)
+ {
+ DPRINT1("QuickAlloc() failed in pSaveImage()\n");
+ return FALSE;
+ }
+ GdipGetImageEncoders(num, size, codecInfo);
+
+ GdipGetImageRawFormat(g_pImage, &rawFormat);
+ if (IsEqualGUID(&rawFormat, &ImageFormatMemoryBMP))
+ rawFormat = ImageFormatBMP;
+
+ nFilterIndex = 0;
+ for (j = 0; j < num; ++j)
+ {
+ if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID))
+ {
+ nFilterIndex = j + 1;
+ break;
+ }
+ }
+
+ Anime_Pause(&pData->m_Anime);
+
+ ret = (nFilterIndex > 0) &&
+ (GdipSaveImageToFile(g_pImage, pszFile, &codecInfo[nFilterIndex - 1].Clsid,
NULL) == Ok);
+ if (!ret)
+ DPRINT1("GdipSaveImageToFile() failed\n");
+
+ Anime_Start(&pData->m_Anime, 0);
+
+ QuickFree(codecInfo);
+ return ret;
+}
+
static VOID
Preview_pSaveImageAs(PPREVIEW_DATA pData)
{
@@ -453,7 +500,10 @@ Preview_pSaveImageAs(PPREVIEW_DATA pData)
}
GdipGetImageEncoders(num, size, codecInfo);
+
GdipGetImageRawFormat(g_pImage, &rawFormat);
+ if (IsEqualGUID(&rawFormat, &ImageFormatMemoryBMP))
+ rawFormat = ImageFormatBMP;
sizeRemain = 0;
for (j = 0; j < num; ++j)
@@ -500,13 +550,13 @@ Preview_pSaveImageAs(PPREVIEW_DATA pData)
c++;
sizeRemain -= sizeof(*c);
- if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID) != FALSE)
+ if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID))
{
sfn.nFilterIndex = j + 1;
}
}
- if (GetSaveFileNameW(&sfn))
+ if (GetSaveFileNameW(&sfn) && sfn.nFilterIndex > 0)
{
Anime_Pause(&pData->m_Anime);
@@ -1266,16 +1316,20 @@ Preview_Delete(PPREVIEW_DATA pData)
HWND hwnd = pData->m_hwnd;
SHFILEOPSTRUCTW FileOp = { hwnd, FO_DELETE };
- if (!g_pCurrentFile)
+ if (!pData->m_szFile[0])
return;
/* FileOp.pFrom must be double-null-terminated */
- GetFullPathNameW(g_pCurrentFile->FileName, _countof(szCurFile) - 1, szCurFile,
NULL);
+ GetFullPathNameW(pData->m_szFile, _countof(szCurFile) - 1, szCurFile, NULL);
szCurFile[_countof(szCurFile) - 2] = UNICODE_NULL; /* Avoid buffer overrun */
szCurFile[lstrlenW(szCurFile) + 1] = UNICODE_NULL;
- GetFullPathNameW(g_pCurrentFile->Next->FileName, _countof(szNextFile),
szNextFile, NULL);
- szNextFile[_countof(szNextFile) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
+ szNextFile[0] = UNICODE_NULL;
+ if (g_pCurrentFile)
+ {
+ GetFullPathNameW(g_pCurrentFile->Next->FileName, _countof(szNextFile),
szNextFile, NULL);
+ szNextFile[_countof(szNextFile) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
+ }
/* Confirm file deletion and delete if allowed */
FileOp.pFrom = szCurFile;
@@ -1295,19 +1349,16 @@ Preview_Delete(PPREVIEW_DATA pData)
static VOID
Preview_Edit(HWND hwnd)
{
- WCHAR szPathName[MAX_PATH];
SHELLEXECUTEINFOW sei;
+ PPREVIEW_DATA pData = Preview_GetData(hwnd);
- if (!g_pCurrentFile)
+ if (!pData->m_szFile[0])
return;
- GetFullPathNameW(g_pCurrentFile->FileName, _countof(szPathName), szPathName,
NULL);
- szPathName[_countof(szPathName) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
-
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.lpVerb = L"edit";
- sei.lpFile = szPathName;
+ sei.lpFile = pData->m_szFile;
sei.nShow = SW_SHOWNORMAL;
if (!ShellExecuteExW(&sei))
{
@@ -1435,6 +1486,24 @@ Preview_OnCommand(HWND hwnd, UINT nCommandID)
}
break;
+ case IDC_ROT_CWSAVE:
+ if (g_pImage)
+ {
+ GdipImageRotateFlip(g_pImage, Rotate270FlipNone);
+ Preview_pSaveImage(pData, pData->m_szFile);
+ Preview_UpdateImage(pData);
+ }
+ break;
+
+ case IDC_ROT_CCWSAVE:
+ if (g_pImage)
+ {
+ GdipImageRotateFlip(g_pImage, Rotate90FlipNone);
+ Preview_pSaveImage(pData, pData->m_szFile);
+ Preview_UpdateImage(pData);
+ }
+ break;
+
case IDC_DELETE:
Preview_Delete(pData);
Preview_UpdateImage(pData);
diff --git a/dll/win32/shimgvw/shimgvw.rc b/dll/win32/shimgvw/shimgvw.rc
index f42c29154cd..bfd63fcb4dd 100644
--- a/dll/win32/shimgvw/shimgvw.rc
+++ b/dll/win32/shimgvw/shimgvw.rc
@@ -28,6 +28,8 @@ IDB_ZOOM_IN BITMAP "res/zoomp.bmp"
IDB_ZOOM_OUT BITMAP "res/zoomm.bmp"
IDB_ROT_CLOCKW BITMAP "res/rot1.bmp"
IDB_ROT_COUNCW BITMAP "res/rot2.bmp"
+IDB_ROT_CWSAVE BITMAP "res/rot1save.bmp"
+IDB_ROT_CCWSAVE BITMAP "res/rot2save.bmp"
IDB_DELETE BITMAP "res/delete.bmp"
IDB_PRINT BITMAP "res/print.bmp"
IDB_SAVEAS BITMAP "res/save.bmp"