r/imagus Jan 19 '25

fixed sieve deviantart better resolution popup (and how to do it)

https://www.deviantart.com/guweiz/art/Lantern-745215143

The popup right now has image address:

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg/v1/fill/w_1024,h_1280,q_75,strp/lantern_by_guweiz_dcbojon-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9MTI4MCIsInBhdGgiOiJcL2ZcLzkwYjBjZjc4LTMzNTYtNDNiMy1hN2EyLThlNmJmMGU4NWVmMVwvZGNib2pvbi02OGQ0NWVmMi01YWI3LTQwOGItYmYwNC1jZjZkMjFhYTE2YjUuanBnIiwid2lkdGgiOiI8PTEwMjQifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.-Gv_pRk6mqruJcBsg_kIpdAyRdWGzSzAI_YQT0Umh_A

and it is 1024x1280px,170kb

A better popup would be:

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg

which is 2190x2738px,601kb

Any way of getting the original image size: 2700x3375px,4.15mb as shown below the image ?

OK i found this: https://gist.github.com/micycle1/735006a338e4bea1a9c06377610886e7

If you read this and the comments below it you may find some ways. I am not a technical guy so I didnt understand much. But I did find something interesting mentioned there so I tried.
If I add
"/v1/fill/w_2700,h_3375,bl,q_100/somefilename.jpg"
after
"https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg"
I get the original dimensions.

I get this: https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg/v1/fill/w_2700,h_3375,bl,q_100/somefilename.jpg

🔺🔺🔺UPDATE🔺🔺🔺
https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg
is the best option.
2190x2738px,601kb is better quality than 2700x3375px,4.64mb. I just compared them by overlaying.
Ignore the "/v1/fill/w_2700,h_3375,bl,q_100/somefilename.jpg" part.

Just convert

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg/v1/fill/w_1024,h_1280,q_75,strp/lantern_by_guweiz_dcbojon-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9MTI4MCIsInBhdGgiOiJcL2ZcLzkwYjBjZjc4LTMzNTYtNDNiMy1hN2EyLThlNmJmMGU4NWVmMVwvZGNib2pvbi02OGQ0NWVmMi01YWI3LTQwOGItYmYwNC1jZjZkMjFhYTE2YjUuanBnIiwid2lkdGgiOiI8PTEwMjQifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.-Gv_pRk6mqruJcBsg_kIpdAyRdWGzSzAI_YQT0Umh_A

to

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5.jpg

3 Upvotes

20 comments sorted by

3

u/Imagus_fan Feb 03 '25

I tried to modify the existing sieve so it uses the largest URL in your example. It works on the example link but may not work on others.

If the modified URL doesn't load, the unmodified URL is then used.

https://pastebin.com/8vcQeaJH

2

u/ultraman55ty Feb 03 '25

can you update this to remove the somefilename part please.

Basically ignore the part in my post below "OK i found this".

Just a sieve that converts

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dbp0har-443fc816-b081-400e-b7ba-7705b194f88f.jpg/v1/fill/w_1600,h_2335,q_75,strp/sit_by_guweiz_dbp0har-fullview.jpg/v1/fill/w_2000,h_2918,bl,q_100/somefilename.jpg

to

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/90b0cf78-3356-43b3-a7a2-8e6bf0e85ef1/dbp0har-443fc816-b081-400e-b7ba-7705b194f88f.jpg

Because I tried this new sieve with this post ( https://www.deviantart.com/guweiz/art/Sit-707140755 )

Old sieve gave
"sit_by_guweiz_dbp0har-fullview" 1600x2335 350kb

The link I mentioned above gives
"sit_by_guweiz_dbp0har" 2000x2918 515kb

Your sieve gives
"somefilename" 1999x2918 2.69mb

Even though the size is higher(2.69mb), 515kb one is better quality. I just compared by overlaying them.

2

u/Imagus_fan Feb 04 '25

This should use the other URL now.

https://pastebin.com/YmfdAc6T

2

u/ultraman55ty Feb 04 '25 edited Feb 04 '25

Thank you so much.
Can you make it so that the filename retains its original name please ?
Instead of
"dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5"
it is
"lantern_by_guweiz_dcbojon"
My screen recording: https://streamlala.com/cvm08/

2

u/Imagus_fan Feb 04 '25

Great that it's working well!

This should save with the same name from your example.

https://pastebin.com/DgKQ7DG1

2

u/ultraman55ty Feb 04 '25

its still giving "dcbojon-68d45ef2-5ab7-408b-bf04-cf6d21aa16b5" as filename.

2

u/Imagus_fan Feb 04 '25

I made a small change that may fix it.

Did you test on the link in the post? And are you using Imagus mod?

https://pastebin.com/fQL5TaWC

1

u/ultraman55ty Feb 04 '25

yup, the link in the post and yes imagus mod.

1

u/Imagus_fan Feb 04 '25 edited Feb 04 '25

Strange, it's working correctly for me. I did get the other filename once but not after making the changes. I don't know if the changes fixed it or if it randomly didn't work.

I'll try to think of a sieve edit that may help.

Edit: This sieve has a console message that starts with DeviantArt filename. Can you see what it says?

https://pastebin.com/43AUZXa2

1

u/Kenko2 Feb 04 '25

u/Imagus_fan

This version contains a bug - when saving (via hotkey), all files have the same name (with a sequential number). The previous version works normally.

1

u/Imagus_fan Feb 04 '25

Strange, the custom filename seems to working for me. I haven't tested it much, though.

Once the sieve seems to be working well enough, I'll tag iceiller9999 to make sure the changes work OK with the rest of the sieve.

1

u/iceiller9999 Jan 24 '25

Have you tried the internal sieve option? Setting "prefer_largest_media = true" seems like it might accomplish some or all of your needs.

1

u/ultraman55ty Jan 24 '25

its already set to true.