Skip to content

Commit

Permalink
feat(web): adaptive qr code image scale (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
KirCute authored Dec 30, 2024
1 parent 9160ee1 commit 35ebb0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/home/previews/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export const Download = (props: { openWith?: boolean }) => {
const t = useT()
const { copyCurrentRawLink } = useCopyLink()
const [qrUrl, setQrUrl] = createSignal("")
QRCode.toDataURL(objStore.raw_url).then((url) => setQrUrl(url))
QRCode.toDataURL(objStore.raw_url, {

This comment has been minimized.

Copy link
@anwen-anyi

anwen-anyi Jan 29, 2025

Contributor

佬,是不是需要回滚一下这里呀,在前端300px效果和之前没区别,复制的或者右新标签打开显示不如之前的清楚哈哈 😄 🥰

如果scale改成0虽然和之前一样清楚了 不过文件变大了0.5倍左右把 从70-80kb 变成了130kb

Image

type: "image/jpeg",
scale: 2,
}).then((url) => setQrUrl(url))
const [pinned, setPinned] = createSignal(false)
const [hover, setHover] = createSignal(false)
return (
Expand Down Expand Up @@ -49,7 +52,7 @@ export const Download = (props: { openWith?: boolean }) => {
<PopoverArrow />
<PopoverBody>
<Image
boxSize="100px"
maxWidth="300px"
src={qrUrl()}
alt="QR Code of download link"
objectFit="cover"
Expand Down

0 comments on commit 35ebb0e

Please sign in to comment.