CruFox
Moderator
I like tags
*Appendix: Fetching from Twitter direct links if fetching from post url doesn't work*
I will use this image as an example: "https://twitter.com/DreamWeaverPony/status/1218553001880801281":https://twitter.com/DreamWeaverPony/status/1218553001880801281
When opening this image in a new tab +without enlarging the image first+ the direct url will be this:[bq]https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=small[/bq]
Notice the @format=@ and @name=@ fields at the end of the url, they are important.
If you instead first clicked on the image to enlarge it and only +then+ opened it viaPPRMB -> open in a new tab you will get a bit different url:
[bq]https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=4096x4096[/bq]
The @name@ parameter changed from @small@ to @4096x4096@. If high resolution png is available then this will have "format=png" in the url, like it is the case on this post: "https://twitter.com/bongwater777/status/1287573323052994564":https://twitter.com/bongwater777/status/1287573323052994564
You can check that if first enlarged and then opened in a new tab the @format=png@ part is already in the url from the start.
I know of those available values for @name=@ (but there might be more):
[bq]small
medium
large
900x900
4096x4096
orig[/bq]
Both @4096x4096@ and @orig@ will give the best possible resolution even when image is less than 4096px, this value seems to be Twitter upper resolution limit.
If you manually change the @format=@ value from @jpg@ to @png@ even though you didn't get a link with @png@ from the start then although you will sometimes get a working image, that might +not be a file of better quality!+. Resulting file might be a PNG that has quality identical to JPG (with compression artifacts) but just have a higher file size.
!https://i.imgur.com/pqapzca.png!
Above is a such an image at 600% zoom. Part of url from first example was manually changed from containing_ @format=+jpg+&name=4096x4096@ "(link)":https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=4096x4096 _to_ @format=+png+&name=4096x4096@ "(link)":https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=4096x4096, _the file size got over 4 times bigger, the format of downloaded file is PNG but image quality is identical to JPG, there are compression artifacts everywhere. There is no point in using images like that.
Note that changing @format=@ to @png@ will +not work+ when @name=orig@ but will work when @name=4096x4096@.
I will use this image as an example: "https://twitter.com/DreamWeaverPony/status/1218553001880801281":https://twitter.com/DreamWeaverPony/status/1218553001880801281
When opening this image in a new tab +without enlarging the image first+ the direct url will be this:[bq]https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=small[/bq]
Notice the @format=@ and @name=@ fields at the end of the url, they are important.
If you instead first clicked on the image to enlarge it and only +then+ opened it via
[bq]https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=4096x4096[/bq]
The @name@ parameter changed from @small@ to @4096x4096@. If high resolution png is available then this will have "format=png" in the url, like it is the case on this post: "https://twitter.com/bongwater777/status/1287573323052994564":https://twitter.com/bongwater777/status/1287573323052994564
You can check that if first enlarged and then opened in a new tab the @format=png@ part is already in the url from the start.
I know of those available values for @name=@ (but there might be more):
[bq]small
medium
large
900x900
4096x4096
orig[/bq]
Both @4096x4096@ and @orig@ will give the best possible resolution even when image is less than 4096px, this value seems to be Twitter upper resolution limit.
If you manually change the @format=@ value from @jpg@ to @png@ even though you didn't get a link with @png@ from the start then although you will sometimes get a working image, that might +not be a file of better quality!+. Resulting file might be a PNG that has quality identical to JPG (with compression artifacts) but just have a higher file size.
!https://i.imgur.com/pqapzca.png!
Above is a such an image at 600% zoom. Part of url from first example was manually changed from containing_ @format=+jpg+&name=4096x4096@ "(link)":https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=4096x4096 _to_ @format=+png+&name=4096x4096@ "(link)":https://pbs.twimg.com/media/EOkrdP7WsAA_Qo0?format=jpg&name=4096x4096, _the file size got over 4 times bigger, the format of downloaded file is PNG but image quality is identical to JPG, there are compression artifacts everywhere. There is no point in using images like that.
Note that changing @format=@ to @png@ will +not work+ when @name=orig@ but will work when @name=4096x4096@.