透過網頁讀取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": [] } } }
карнизы с электроприводом купить карнизы с электроприводом купить .
Добрый день!
Заказать диплом любого ВУЗа.
mandiplomikx.ru/kupit-diplom-novosibirsk
Добрый день!
Купить диплом ВУЗа.
diplomman.ru/kupit-diplom-sssr
Привет!
Заказать диплом любого университета.
mandiplomik.ru/kupit-diplom-sssr
my webpage … Explore Daycares Locations
cialis canada pharmacy no prescription required: cialis blac – sell of cialis
Betfair Casino Espana
betfair casino bonus
Si estas en la busqueda de un casino online en Espana que ofrezca fiabilidad, podria ser la opcion perfecta. Con licencia y cumpliendo con los mas altos estandares de seguridad, este casino destaca por su variada seleccion de juegos proporcionados por los mas renombrados desarrolladores a nivel mundial. Desde tragamonedas clasicas hasta envolventes juegos de casino en vivo, Betfair Casino se ha convertido en el destino favorito de numerosos jugadores espanoles. Descubre en nuestra resena por que Betfair Casino ha logrado captar la atencion de tantos usuarios y conoce en detalle las caracteristicas que lo hacen destacar en el sector.
Resena sobre Betfair Casino Espana
Betfair Casino se ha establecido firmemente en el mercado de juegos de azar espanol como una opcion de confianza para los entusiastas del casino online. Operado por Betfair Casino Limited, este sitio esta acreditado por la Comision de Juegos del Reino Unido y la Autoridad de Juegos de Malta, ofreciendo un ambiente de juego seguro y regulado. A continuacion, te proporcionamos informacion relevante sobre Betfair Casino en Espana.
пин ап казино вход
карнизы для штор с электроприводом карнизы для штор с электроприводом .
электрокарниз цена https://elektrokarniz1.ru/ .
Jokabet Casino Espana: analisis completo (2024)
jokabet opiniones
Introduccion a Jokabet Casino
Jokabet Casino ha emergido como una de las plataformas de juegos de azar en linea mas populares en Espana en 2024. Este analisis completo tiene como objetivo proporcionar una vision detallada de lo que ofrece este casino, desde su seguridad hasta sus juegos y promociones.
Jugar en Jokabet Casino: ?Es seguro y confiable?
Antes de aventurarte en el mundo de Jokabet Casino, es natural preguntarse sobre su seguridad. La plataforma esta licenciada y regulada por autoridades reconocidas, garantizando un entorno de juego seguro y justo para todos sus usuarios.
Los mejores bonos y promociones de Jokabet Casino
Bonos de bienvenida
ofrece generosos bonos de bienvenida para nuevos jugadores, incluyendo dinero extra y giros gratis. Con un bono Jokabet inicial, puedes empezar a explorar todas las oportunidades que este casino ofrece.
Promociones regulares
Los jugadores habituales pueden disfrutar de diversas promociones regulares, como bonos de recarga y torneos.
Programas de fidelidad
El programa de fidelidad de Jokabet recompensa a los jugadores leales con puntos que pueden canjearse por premios y beneficios exclusivos.
акрил молочный 10 мм https://polikarbonat-sotovyj.ru/
Boost kasiino – ametlik kodulehekulg Eestis: taielik ulevaade
boost casino estonia
on Eesti mangurite seas kiiresti populaarsust kogunud. Kaesolevas artiklis vaatleme, miks Boost casino eesti on saavutanud sellise edu, kasitledes selle peamisi funktsioone ja pakutavaid teenuseid, sealhulgas manguvalikuid, boonuseid ja kasutajasobralikku liidest.
Boostcasino Mangude Ulevaade
Boost Casino pakub laia valikut ponevaid mange, mis meeldivad igale mangijale, alates algajatest kuni kogenud hasartmangusopradeni. Selles jaotises saate teada, milliseid erinevaid mange Boost Casino pakub, sealhulgas populaarseid manguautomaate ja lauamange, samuti live-kasiino voimalusi, mis pakuvad mangijatele toelist kasiinokogemust mugavalt oma kodus.
Slotid ja Lauamangud
Boost Casino’s on esindatud sadu slotimange erinevatelt arendajatelt, nagu NetEnt, Microgaming ja Play’n GO, mis tagab kvaliteetsed graafikad ja sujuva mangukogemuse. Lisaks klassikalistele slotidele leidub laialdaselt lauamange, sealhulgas:
1. Blackjack: Mitu varianti, nagu klassikaline, Euroopa ja Vegas Strip.
2. Rulett: Euroopa, Ameerika ja Prantsuse rulett.
3. Baccarat: Punto Banco ja kiire tempo baccarat.
Nende mangude RTP (Return to Player) maarad on tavaliselt vaga konkurentsivoimelised, mis tostab mangijate voiduvoimalusi. Boost Casino uuendab regulaarselt oma mangude valikut, pakkudes uusi ja ponevaid variante.
Начните играть в Sugar Rush и выигрывайте по-крупному, sugar rush демо с реальными деньгами
ISIS-inspired suspect planned suicide attack at Taylor Swift concert, Austrian authorities say
1xbet free promo code
Police in Austria have questioned three teenagers suspected of plotting a suicide attack at a Taylor Swift show, sparking renewed concerns over the indoctrination of young people online.
Foreign intelligence agencies helped authorities uncover the alleged scheme, according to the country’s Interior Minister Gerhard Karner. A source familiar told CNN that the US issued a warning to authorities in Vienna.
Organizers canceled three concerts, which were scheduled to take place in the European capital from Thursday to Saturday. CNN has reached out to Swift’s representatives for comment.
Investigators unearthed a stockpile of chemicals, explosive devices, detonators and 21,000 euros in counterfeit cash at the home of the main suspect, a 19-year-old ISIS sympathizer who had been radicalized online, according to authorities.
The young man – who was arrested Wednesday morning in the eastern town of Ternitz – planned to kill himself and “a large number of people,” according to the head of the domestic intelligence agency, Omar Haijawi-Pirchner.
“He said he intended to carry out an attack using explosives and knives,” Haijawi-Pirchner told reporters in Vienna on Thursday. “His aim was to kill himself and a large number of people during the concert, either today or tomorrow.”
Two other suspects were detained, aged 17 and 15. The 17-year-old worked for a facilities company that would have provided services at the concert venue. He was near the stadium when he was arrested and had recently broken up with his girlfriend, according to Haijwai-Pirchner.
Little has been revealed about the 15-year-old. Prosecutors will decide later if he was a witness or directly involved in the alleged plot.
The three are all Austrian-born with either Turkish, North Macedonian or Croatian backgrounds.
Baji Live Casino Overview
bajilive-casino.com
Every casino in the world claims that its uniqueness and originality are the reasons for their existence, but what makes Baji Live casino so special is its unique history and modern technologies. Baji Live Casino is not only a place where you can bet your money on games; it’s also a blending of technology and the user interface that altogether gives an unprecedented gaming experience.
History and Licensing
Baji Live Casino is licensed by the Curacao Gaming Commission, one of the most problematic and legitimate online casino licences in the world. Why they chose Curacao would do Columbus be the most peaceful and the most economically sound. The most important thing is the game poker license of Curacao. It has these kinds of features:
International Rights: Curacao’s gaming license is known for its honesty and transparency. It is accepted in many countries and is a legal way for operators to launch services into a wider spectrum of markets worldwide.
Regulation with Control: Baji Live Casino should stay according to a variety of the different regulations which are the part of the license such as game fairness, user data protection, and the conduct of responsible gaming and security measures.
Audits and Checks: An auditing team is responsible for conducting regular control procedures of the casino. They are bankrolled by eCOGRA, and their ultimate aim is to ensure casino compliance with convenient, fair play and user safety requirements.
Transaction Security: Curacao is the place where special attention is paid to the protection of financial transactions, which is essential to the safety and prevention of fraud among the players as well.
For additional access and to alleviate blockers, our website provides mirror URLs like baji live 365, baji live 999, and baji 888 live. By means of this service, users can make requests as though they are in an unrestricted area and carry out transactions. The whole system, also, gives a high level of trust and security to Baji Live Casino users, which of course makes it really attractive to everybody that wants to either learn or play at an online casino. The stick to such strict licensing standards is the evidence that Baji Live I not only manages, but it is also strengthening its image as a reliable and responsible gambling provider in the market.
Привет, друзья!
Мы предлагаем дипломы любых профессий по приятным тарифам.
rushkas-diploms.ru/kupit-diplom-novosibirsk
Здравствуйте!
Мы можем предложить дипломы любой профессии по разумным ценам.
diploms-rushka.ru/otzyvy-i-kommentarii
Great site! I recommend it to everyone!Private jet charter
Привет!
Легальная покупка диплома о среднем образовании в Москве и регионах
diplomyx-man.ru/svidetelstvo-o-rozhdenii-sssr1
Поможем вам всегда!.
Добрый день!
Полезная информация как купить диплом о высшем образовании без рисков
mans-diplomasxx.ru/kupit-diplom-samara
Будем рады вам помочь!.
Привет, друзья!
Диплом вуза купить официально с упрощенным обучением в Москве
mandiplomik.ru/kupit-svidetelstva
Рады оказать помощь!.
https://megabook.ru/article/%D0%9C%D0%B0%D0%B3%D0%BD%D0%B8%D1%82%D0%BD%D0%BE-%D1%80%D0%B5%D0%B7%D0%BE%D0%BD%D0%B0%D0%BD%D1%81%D0%BD%D0%B0%D1%8F%20%D1%82%D0%BE%D0%BC%D0%BE%D0%B3%D1%80%D0%B0%D1%84%D0%B8%D1%8F%20%D0%B3%D0%B8%D0%BF%D0%BF%D0%BE%D0%BA%D0%B0%D0%BC%D0%BF%D0%B0
https://prodvizhenie-korolev.ru/
buy viagra: Viagra without a doctor prescription – viagra coupons
Добрый день!
Как получить диплом техникума официально и без лишних проблем
rushkadiplomik.ru
Здравствуйте!
Можно ли быстро купить диплом старого образца и в чем подвох?
rushkadiplomik.ru
http://tadalafil.auction/# cialis 20mg
I’m not sure why but this site is loading extremely slow for me. Is anyone else having this issue or is it a issue on my end? I’ll check back later on and see if the problem still exists.
https://kitalararasi.org/