透過網頁讀取Photoshop PSD檔案內容
在專案中有需要透過網頁來讀取Photoshop PSD檔案的內部資訊,我們透過PSD.js(備用載點)來實現這樣的功能,在官方提供的功能展示頁中,我們可以看到在頁面中只需引入psd.min.js後,加入透過少量的Javascript就可以針對PSD進行解析。
<!DOCTYPE html> <html> <head> <title>psd.js image example</title> <style type="text/css"> body, html { padding: 0; margin: 0; } #dropzone { width: 500px; height: 100px; border: 1px #ababab dashed; margin: 50px auto; } #dropzone p { text-align: center; line-height: 100px; margin: 0; padding: 0; } #image { text-align: center; } </style> <script type="text/javascript" src="psd.min.js"></script> </head> <body> <div id="dropzone"> <p>Drop here</p> </div> <div id="image"></div> <pre id="data"></pre> <script type="text/javascript"> (function () { var PSD = require('psd'); document.getElementById('dropzone').addEventListener('dragover', onDragOver, true); document.getElementById('dropzone').addEventListener('drop', onDrop, true); function onDragOver(e) { e.stopPropagation(); e.preventDefault(); e.dataTransfer.dropEffect = 'copy'; } function onDrop(e) { e.stopPropagation(); e.preventDefault(); PSD.fromEvent(e).then(function (psd) { var data = JSON.stringify(psd.tree().export(), undefined, 2); document.getElementById('data').innerHTML = data; document.getElementById('image').appendChild(psd.image.toPng()); }); } }()); </script> </body> </html>
我們透過下圖這樣的一個PSD檔案對頁面進行測試,檔案中共有三個圖層,包含一個文字圖層。

頁面將PSD分析出結果後,以json格式顯示在頁面上,可以看到文字圖層的部分,不僅能讀到圖層名稱也包含文字內容和字型名稱。
{ "children": [ { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "Photoshop Text", "left": 302, "right": 723, "top": 90, "bottom": 128, "height": 38, "width": 421, "mask": {}, "text": { "value": "THIS IS TEXT LAYER", "font": { "name": "MyriadPro-Regular\u0000", "sizes": [ 53 ], "colors": [ [ 0, 0, 0, 255 ] ], "alignment": [ "center" ] }, "left": 0, "top": 0, "right": 0, "bottom": 0, "transform": { "xx": 1, "xy": 0, "yx": 0, "yy": 1, "tx": 513, "ty": 127 } }, "image": {} }, { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "PSD Icon", "left": 287, "right": 738, "top": 209, "bottom": 669, "height": 460, "width": 451, "mask": {}, "image": {} }, { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "Background", "left": 0, "right": 1024, "top": 0, "bottom": 800, "height": 800, "width": 1024, "mask": {}, "image": {} } ], "document": { "width": 1024, "height": 800, "resources": { "layerComps": [], "guides": [], "slices": [] } } }
slot88.company slot88.company Pemain harus memahami aturan masing-masing mesin
Mesin slot menawarkan pengalaman bermain yang cepat http://bonaslot.site/# Banyak pemain menikmati jackpot harian di slot
Slot dengan tema film terkenal menarik banyak perhatian https://preman69.tech/# Slot menawarkan berbagai jenis permainan bonus
Look of the Week: Kendrick Lamar’s Super Bowl pants signal the return of flares
kraken официальный сайт
This year’s Super Bowl halftime show was hardly a fashion extravaganza, with headliner Kendrick Lamar keeping things simple in a backwards cap and motorbike-style varsity jacket, which he kept on throughout.
And without the costume-change roulette we’ve come to expect of halftime shows, the internet fixated on one item in particular: his jeans.
While not quite the bell-bottoms of decades past (the 1970s and the 2000s, specifically), the Compton-born rapper’s washed denim pants flared out at the knee and dragged beneath his heels along the stage at Caesars Superdrome in New Orleans. His silhouette stood in stark contrast to that of record producer Mustard, who made a brief cameo in a pair of outsized jeans straight from the West Coast hip-hop playbook.
Opinions were, as ever, divided on social media. Some users described Lamar’s flares as “women’s jeans” and “Hannah Montana pants,” earning him comparisons to everyone from Jennifer Aniston to country singer Lainey Wilson. Others joked that their moms were looking for a similar pair or that they nodded to millennials, for whom flares were a teenage staple.
But those suggesting his style was outdated, or gender-inappropriate, may not have been paying attention to the recent resurgence of flares — in both womenswear and menswear. After all, Lamar’s jeans were designed by one of the most influential figures in modern fashion, Celine’s former creative director Hedi Slimane, before he departed the French label in October.
Cute baby animals bring visitors to zoos and aquariums. What happens when they grow up?
арбитраж трафика каналы
One of the best things that can happen to a zoo or aquarium is for one of their resident animals to go viral.
Just look at the multi-hour-long lines to see Moo Deng, a pygmy hippo in Thailand who has become an internet sensation following her July 2024 birth. The sassy animal is now a full-on brand, with Khao Kheow Open Zoo selling Moo Deng merchandise and even releasing a single “by” the hippo in multiple languages.
Meanwhile, Pesto — a baby king penguin who was eating more fish than his parents by the time he was a few weeks old — is also an online celebrity, with human stars like Olivia Rodrigo and Katy Perry stopping by to meet him.
But what happens when these cute animals become, well, less cute? The Sea Life Melbourne aquarium has already been planning for the next phase of Pesto’s life — and answering questions from the public about his changing appearance.
It’s normal for king penguins to lose their feathers by the time they’re about a year old and become confident swimmers. As a result, a spokesperson for the aquarium says, guests have started asking why Pesto looks different — or why they can’t find him at all.
“We are getting a few guests thinking we have moved him off display completely,” says the spokesperson. “Most of the team’s time is spent pointing him out to guests because he looks so different now.”
The bottom line is that cute baby animals make money.
Admission tickets are only the beginning. Many zoos and aquariums offer special “behind the scenes” or “zookeeper for a day” packages at much higher prices. At Sea Life Melbourne, standard entry tickets for adults start at $51, while the Penguin Passport — which include a 45-minute tour of the birds’ area and a look at how their food is prepared — is $199.
The real jackpot, though, is merchandise. Stuffed animals, T-shirts, fridge magnets, keychains, kids’ books and other branded products are a major way for zoos and aquariums to make money.
Scores of unexploded World War II bombs discovered under children’s playground
lucky jet играть
Scores of unexploded bombs dating from World War II have been recovered from a children’s playground in northern England after a chance discovery.
Local officials in the town of Wooler, Northumberland called in bomb disposal experts after workers involved in a planned overhaul of Scotts Play Park found unexploded ordnance, the parish council said in a statement sent to CNN on Monday.
Two bombs were initially removed by the British Army, the UK Ministry of Defense said in a statement. The parish council was then advised that a full survey of the area was required, according to a council spokesperson.
Bomb disposal company Brimstone Site Investigation then uncovered 65 10-pound practice bombs and smoke cartridges on the first day of works, with a further 90 practice bombs recovered on the second day.
The company told CNN that the bombs date from World War II.
According to the parish council, all of the bombs need to be found and removed before the park can be reopened. It said 174 devices had been found so far.
https://www.chelyabinskhockey.ru/pub/news/cergey-mylnikov-u-nas-kazhdaya-igra-kak-pley-off-potomu-chto-vse-ponimayut-v-kakom-polozhenii-my-nakh/?MID=326826&result=reply
https://slot88.company/# Kasino sering mengadakan turnamen slot menarik
My website :: online dating sites for professionals
Korean cosmetics http://kungur.hldns.ru/forum/profile.php?action=show&member=625 perfect skin without effort! Innovative formulas, Asian traditions and visible results. Try the best skin care products right now!
http://slotdemo.auction/# Kasino sering memberikan hadiah untuk pemain setia
Banyak kasino menawarkan permainan langsung yang seru http://slotdemo.auction/# Slot menawarkan kesenangan yang mudah diakses
п»їKasino di Indonesia sangat populer di kalangan wisatawan http://preman69.tech/# Banyak pemain berusaha untuk mendapatkan jackpot
Astronomers briefly thought Elon Musk’s car was an asteroid. Here’s why that points to a broader problem
skraken darknet onion
Seven years after SpaceX launched Elon Musk’s cherry red sports car into orbit around our sun, astronomers unwittingly began paying attention to its movements once again.
Observers spotted and correctly identified the vehicle as it started its extraterrestrial excursion in February 2018 — after it had blasted off into space during the Falcon Heavy rocket’s splashy maiden launch. But more recently, the car spawned a high-profile case of mistaken identity as space observers mistook it for an asteroid.
Several observations of the vehicle, gathered by sweeping surveys of the night sky, were inadvertently stashed away in a database meant for miscellaneous and unknown objects, according to the International Astronomical Union’s Minor Planet Center.
An amateur astronomer noticed a string of data points in January that appeared to fit together, describing the orbit of a relatively small object that was swooping between the orbital paths of Earth and Mars.
The citizen scientist assumed the mystery object was an undocumented asteroid and promptly sent his findings to the MPC, which operates at the Harvard Smithsonian Center for Astrophysics in Cambridge, Massachusetts, as a clearinghouse that seeks to catalog all known asteroids, comets and other small celestial bodies. An astronomer there verified the finding.
And thus, the Minor Planet Center logged a new object, asteroid “2018 CN41.”
Within 24 hours, however, the center retracted the designation.
The person who originally flagged the object realized their own error, MPC astronomer Peter Veres told CNN, noticing that they had, in fact, found several uncorrelated observations of Musk’s car. And the center’s systems hadn’t caught the error.
Slot dengan tema budaya lokal menarik perhatian http://slotdemo.auction/# Slot klasik tetap menjadi favorit banyak orang
Korean cosmetics https://demcra.com/r/shopping/1215375_colorgram_makeup perfect skin without effort! Innovative formulas, Asian traditions and visible results. Try the best skin care products right now!
our website https://my-sollet.com
Korean cosmetics http://www.randy-harrison.it/gallery/profile.php?uid=156361 perfect skin without effort! Innovative formulas, Asian traditions and visible results. Try the best skin care products right now!
Banyak pemain menikmati jackpot harian di slot http://slot88.company/# Slot menjadi bagian penting dari industri kasino
Kasino sering memberikan hadiah untuk pemain setia: BonaSlot – bonaslot
check over here https://web-kaspawallet.com
read here https://my-sollet.com
imp source https://my-sollet.com/
Pemain harus memahami aturan masing-masing mesin: slot demo pg gratis – slot demo rupiah
Kasino memiliki suasana yang energik dan menyenangkan: slot demo – slotdemo
Astronomers briefly thought Elon Musk’s car was an asteroid. Here’s why that points to a broader problem
skraken магазин
Seven years after SpaceX launched Elon Musk’s cherry red sports car into orbit around our sun, astronomers unwittingly began paying attention to its movements once again.
Observers spotted and correctly identified the vehicle as it started its extraterrestrial excursion in February 2018 — after it had blasted off into space during the Falcon Heavy rocket’s splashy maiden launch. But more recently, the car spawned a high-profile case of mistaken identity as space observers mistook it for an asteroid.
Several observations of the vehicle, gathered by sweeping surveys of the night sky, were inadvertently stashed away in a database meant for miscellaneous and unknown objects, according to the International Astronomical Union’s Minor Planet Center.
An amateur astronomer noticed a string of data points in January that appeared to fit together, describing the orbit of a relatively small object that was swooping between the orbital paths of Earth and Mars.
The citizen scientist assumed the mystery object was an undocumented asteroid and promptly sent his findings to the MPC, which operates at the Harvard Smithsonian Center for Astrophysics in Cambridge, Massachusetts, as a clearinghouse that seeks to catalog all known asteroids, comets and other small celestial bodies. An astronomer there verified the finding.
And thus, the Minor Planet Center logged a new object, asteroid “2018 CN41.”
Within 24 hours, however, the center retracted the designation.
The person who originally flagged the object realized their own error, MPC astronomer Peter Veres told CNN, noticing that they had, in fact, found several uncorrelated observations of Musk’s car. And the center’s systems hadn’t caught the error.
Сауна очищает организм https://sauna-broadway.ru выводя токсины через пот, укрепляет иммунитет благодаря перепадам температуры, снимает стресс, расслабляя мышцы и улучшая кровообращение. Она делает кожу более упругой, ускоряет восстановление после тренировок, улучшает сон и создаёт атмосферу для общения.
Сауна очищает организм https://sauna-broadway.ru выводя токсины через пот, укрепляет иммунитет благодаря перепадам температуры, снимает стресс, расслабляя мышцы и улучшая кровообращение. Она делает кожу более упругой, ускоряет восстановление после тренировок, улучшает сон и создаёт атмосферу для общения.
my latest blog post https://my-sollet.com/
Cute baby animals bring visitors to zoos and aquariums. What happens when they grow up?
арбитраж обучение
One of the best things that can happen to a zoo or aquarium is for one of their resident animals to go viral.
Just look at the multi-hour-long lines to see Moo Deng, a pygmy hippo in Thailand who has become an internet sensation following her July 2024 birth. The sassy animal is now a full-on brand, with Khao Kheow Open Zoo selling Moo Deng merchandise and even releasing a single “by” the hippo in multiple languages.
Meanwhile, Pesto — a baby king penguin who was eating more fish than his parents by the time he was a few weeks old — is also an online celebrity, with human stars like Olivia Rodrigo and Katy Perry stopping by to meet him.
But what happens when these cute animals become, well, less cute? The Sea Life Melbourne aquarium has already been planning for the next phase of Pesto’s life — and answering questions from the public about his changing appearance.
It’s normal for king penguins to lose their feathers by the time they’re about a year old and become confident swimmers. As a result, a spokesperson for the aquarium says, guests have started asking why Pesto looks different — or why they can’t find him at all.
“We are getting a few guests thinking we have moved him off display completely,” says the spokesperson. “Most of the team’s time is spent pointing him out to guests because he looks so different now.”
The bottom line is that cute baby animals make money.
Admission tickets are only the beginning. Many zoos and aquariums offer special “behind the scenes” or “zookeeper for a day” packages at much higher prices. At Sea Life Melbourne, standard entry tickets for adults start at $51, while the Penguin Passport — which include a 45-minute tour of the birds’ area and a look at how their food is prepared — is $199.
The real jackpot, though, is merchandise. Stuffed animals, T-shirts, fridge magnets, keychains, kids’ books and other branded products are a major way for zoos and aquariums to make money.