├── .gitignore ├── LICENSE ├── MyQR ├── __init__.py ├── mylibs │ ├── ECC.py │ ├── __init__.py │ ├── constant.py │ ├── data.py │ ├── draw.py │ ├── matrix.py │ ├── structure.py │ └── theqrmodule.py ├── myqr.py └── terminal.py ├── Procfile ├── README.md ├── app ├── __init__.py ├── generator │ └── __init__.py ├── routes.py ├── static │ ├── css │ │ ├── app.0f2a6adf.css │ │ ├── app.8374fd63.css │ │ └── chunk-vendors.d9890480.css │ ├── favicon.ico │ ├── fonts │ │ ├── element-icons.535877f5.woff │ │ └── element-icons.732389de.ttf │ ├── img │ │ └── logo.528852a8.gif │ └── js │ │ ├── app.127c97bd.js │ │ ├── app.127c97bd.js.map │ │ ├── app.a53b71ff.js │ │ ├── app.a53b71ff.js.map │ │ ├── app.aef7f405.js │ │ ├── app.aef7f405.js.map │ │ ├── app.b795e18d.js │ │ ├── app.b795e18d.js.map │ │ ├── app.f8838470.js │ │ ├── app.f8838470.js.map │ │ ├── chunk-vendors.551a2727.js │ │ ├── chunk-vendors.551a2727.js.map │ │ ├── chunk-vendors.70868458.js │ │ └── chunk-vendors.70868458.js.map └── templates │ └── index.html ├── awesome_qrcode.py └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | 106 | # PyCharm 107 | .idea/ 108 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MyQR/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwenjian/awesome-qrcode/06ec717f03787897c37f2ab050161ac06b49529f/MyQR/__init__.py -------------------------------------------------------------------------------- /MyQR/mylibs/ECC.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from MyQR.mylibs.constant import GP_list, ecc_num_per_block, lindex, po2, log 4 | 5 | #ecc: Error Correction Codewords 6 | def encode(ver, ecl, data_codewords): 7 | en = ecc_num_per_block[ver-1][lindex[ecl]] 8 | ecc = [] 9 | for dc in data_codewords: 10 | ecc.append(get_ecc(dc, en)) 11 | return ecc 12 | 13 | def get_ecc(dc, ecc_num): 14 | gp = GP_list[ecc_num] 15 | remainder = dc 16 | for i in range(len(dc)): 17 | remainder = divide(remainder, *gp) 18 | return remainder 19 | 20 | def divide(MP, *GP): 21 | if MP[0]: 22 | GP = list(GP) 23 | for i in range(len(GP)): 24 | GP[i] += log[MP[0]] 25 | if GP[i] > 255: 26 | GP[i] %= 255 27 | GP[i] = po2[GP[i]] 28 | return XOR(GP, *MP) 29 | else: 30 | return XOR([0]*len(GP), *MP) 31 | 32 | 33 | def XOR(GP, *MP): 34 | MP = list(MP) 35 | a = len(MP) - len(GP) 36 | if a < 0: 37 | MP += [0] * (-a) 38 | elif a > 0: 39 | GP += [0] * a 40 | 41 | remainder = [] 42 | for i in range(1, len(MP)): 43 | remainder.append(MP[i]^GP[i]) 44 | return remainder -------------------------------------------------------------------------------- /MyQR/mylibs/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /MyQR/mylibs/constant.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | ***** for data.py ******* 4 | """ 5 | # character capacities 6 | # {level1: [version1(mode1,mode2,mode3,mode4), version2(..,..,..,..), ...], 7 | # level2: [version1(mode1,mode2,mode3,mode4), version2(..,..,..,..),...], 8 | # ...} 9 | char_cap = { 10 | 'L': [(41, 25, 17, 10), (77, 47, 32, 20), (127, 77, 53, 32), (187, 114, 78, 48), (255, 154, 106, 65), (322, 195, 134, 82), (370, 224, 154, 95), (461, 279, 192, 118), (552, 335, 230, 141), (652, 395, 271, 167), (772, 468, 321, 198), (883, 535, 367, 226), (1022, 619, 425, 262), (1101, 667, 458, 282), (1250, 758, 520, 320), (1408, 854, 586, 361), (1548, 938, 644, 397), (1725, 1046, 718, 442), (1903, 1153, 792, 488), (2061, 1249, 858, 528), (2232, 1352, 929, 572), (2409, 1460, 1003, 618), (2620, 1588, 1091, 672), (2812, 1704, 1171, 721), (3057, 1853, 1273, 784), (3283, 1990, 1367, 842), (3517, 2132, 1465, 902), (3669, 2223, 1528, 940), (3909, 2369, 1628, 1002), (4158, 2520, 1732, 1066), (4417, 2677, 1840, 1132), (4686, 2840, 1952, 1201), (4965, 3009, 2068, 1273), (5253, 3183, 2188, 1347), (5529, 3351, 2303, 1417), (5836, 3537, 2431, 1496), (6153, 3729, 2563, 1577), (6479, 3927, 2699, 1661), (6743, 4087, 2809, 1729), (7089, 4296, 2953, 1817)], 11 | 'M': [(34, 20, 14, 8), (63, 38, 26, 16), (101, 61, 42, 26), (149, 90, 62, 38), (202, 122, 84, 52), (255, 154, 106, 65), (293, 178, 122, 75), (365, 221, 152, 93), (432, 262, 180, 111), (513, 311, 213, 131), (604, 366, 251, 155), (691, 419, 287, 177), (796, 483, 331, 204), (871, 528, 362, 223), (991, 600, 412, 254), (1082, 656, 450, 277), (1212, 734, 504, 310), (1346, 816, 560, 345), (1500, 909, 624, 384), (1600, 970, 666, 410), (1708, 1035, 711, 438), (1872, 1134, 779, 480), (2059, 1248, 857, 528), (2188, 1326, 911, 561), (2395, 1451, 997, 614), (2544, 1542, 1059, 652), (2701, 1637, 1125, 692), (2857, 1732, 1190, 732), (3035, 1839, 1264, 778), (3289, 1994, 1370, 843), (3486, 2113, 1452, 894), (3693, 2238, 1538, 947), (3909, 2369, 1628, 1002), (4134, 2506, 1722, 1060), (4343, 2632, 1809, 1113), (4588, 2780, 1911, 1176), (4775, 2894, 1989, 1224), (5039, 3054, 2099, 1292), (5313, 3220, 2213, 1362), (5596, 3391, 2331, 1435)], 12 | 'Q': [(27, 16, 11, 7), (48, 29, 20, 12), (77, 47, 32, 20), (111, 67, 46, 28), (144, 87, 60, 37), (178, 108, 74, 45), (207, 125, 86, 53), (259, 157, 108, 66), (312, 189, 130, 80), (364, 221, 151, 93), (427, 259, 177, 109), (489, 296, 203, 125), (580, 352, 241, 149), (621, 376, 258, 159), (703, 426, 292, 180), (775, 470, 322, 198), (876, 531, 364, 224), (948, 574, 394, 243), (1063, 644, 442, 272), (1159, 702, 482, 297), (1224, 742, 509, 314), (1358, 823, 565, 348), (1468, 890, 611, 376), (1588, 963, 661, 407), (1718, 1041, 715, 440), (1804, 1094, 751, 462), (1933, 1172, 805, 496), (2085, 1263, 868, 534), (2181, 1322, 908, 559), (2358, 1429, 982, 604), (2473, 1499, 1030, 634), (2670, 1618, 1112, 684), (2805, 1700, 1168, 719), (2949, 1787, 1228, 756), (3081, 1867, 1283, 790), (3244, 1966, 1351, 832), (3417, 2071, 1423, 876), (3599, 2181, 1499, 923), (3791, 2298, 1579, 972), (3993, 2420, 1663, 1024)], 13 | 'H': [(17, 10, 7, 4), (34, 20, 14, 8), (58, 35, 24, 15), (82, 50, 34, 21), (106, 64, 44, 27), (139, 84, 58, 36), (154, 93, 64, 39), (202, 122, 84, 52), (235, 143, 98, 60), (288, 174, 119, 74), (331, 200, 137, 85), (374, 227, 155, 96), (427, 259, 177, 109), (468, 283, 194, 120), (530, 321, 220, 136), (602, 365, 250, 154), (674, 408, 280, 173), (746, 452, 310, 191), (813, 493, 338, 208), (919, 557, 382, 235), (969, 587, 403, 248), (1056, 640, 439, 270), (1108, 672, 461, 284), (1228, 744, 511, 315), (1286, 779, 535, 330), (1425, 864, 593, 365), (1501, 910, 625, 385), (1581, 958, 658, 405), (1677, 1016, 698, 430), (1782, 1080, 742, 457), (1897, 1150, 790, 486), (2022, 1226, 842, 518), (2157, 1307, 898, 553), (2301, 1394, 958, 590), (2361, 1431, 983, 605), (2524, 1530, 1051, 647), (2625, 1591, 1093, 673), (2735, 1658, 1139, 701), (2927, 1774, 1219, 750), (3057, 1852, 1273, 784)] 14 | } 15 | 16 | mindex = {'numeric':0, 'alphanumeric':1, 'byte':2, 'kanji':3} 17 | 18 | # [ 19 | # version1[level1,level2,level3,level4], 20 | # version2[..,..,..,..], 21 | # ... 22 | # ] 23 | required_bytes = [ 24 | [19, 16, 13, 9], [34, 28, 22, 16], [55, 44, 34, 26], [80, 64, 48, 36], [108, 86, 62, 46], [136, 108, 76, 60], [156, 124, 88, 66], [194, 154, 110, 86], [232, 182, 132, 100], [274, 216, 154, 122], [324, 254, 180, 140], [370, 290, 206, 158], [428, 334, 244, 180], [461, 365, 261, 197], [523, 415, 295, 223], [589, 453, 325, 253], [647, 507, 367, 283], [721, 563, 397, 313], [795, 627, 445, 341], [861, 669, 485, 385], [932, 714, 512, 406], [1006, 782, 568, 442], [1094, 860, 614, 464], [1174, 914, 664, 514], [1276, 1000, 718, 538], [1370, 1062, 754, 596], [1468, 1128, 808, 628], [1531, 1193, 871, 661], [1631, 1267, 911, 701], [1735, 1373, 985, 745], [1843, 1455, 1033, 793], [1955, 1541, 1115, 845], [2071, 1631, 1171, 901], [2191, 1725, 1231, 961], [2306, 1812, 1286, 986], [2434, 1914, 1354, 1054], [2566, 1992, 1426, 1096], [2702, 2102, 1502, 1142], [2812, 2216, 1582, 1222], [2956, 2334, 1666, 1276] 25 | ] 26 | 27 | num_list = '0123456789' 28 | alphanum_list = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:' 29 | 30 | # [ 31 | # version1[ 32 | # level1(num_of_group_1_blocks, DC_per_group_1_block, num_of_group_2_blocks, DC_per_group_2_block), 33 | # level2(..,..,..,..), 34 | # level3(..,..,..,..), 35 | # level4(..,..,..,..) 36 | # ], 37 | # version2[level1(..), level2(..), level3(..), level4(..)], 38 | # ... 39 | # ] 40 | grouping_list = [ 41 | [(1, 19, 0, 0), (1, 16, 0, 0), (1, 13, 0, 0), (1, 9, 0, 0)], [(1, 34, 0, 0), (1, 28, 0, 0), (1, 22, 0, 0), (1, 16, 0, 0)], [(1, 55, 0, 0), (1, 44, 0, 0), (2, 17, 0, 0), (2, 13, 0, 0)], [(1, 80, 0, 0), (2, 32, 0, 0), (2, 24, 0, 0), (4, 9, 0, 0)], [(1, 108, 0, 0), (2, 43, 0, 0), (2, 15, 2, 16), (2, 11, 2, 12)], [(2, 68, 0, 0), (4, 27, 0, 0), (4, 19, 0, 0), (4, 15, 0, 0)], [(2, 78, 0, 0), (4, 31, 0, 0), (2, 14, 4, 15), (4, 13, 1, 14)], [(2, 97, 0, 0), (2, 38, 2, 39), (4, 18, 2, 19), (4, 14, 2, 15)], [(2, 116, 0, 0), (3, 36, 2, 37), (4, 16, 4, 17), (4, 12, 4, 13)], [(2, 68, 2, 69), (4, 43, 1, 44), (6, 19, 2, 20), (6, 15, 2, 16)], [(4, 81, 0, 0), (1, 50, 4, 51), (4, 22, 4, 23), (3, 12, 8, 13)], [(2, 92, 2, 93), (6, 36, 2, 37), (4, 20, 6, 21), (7, 14, 4, 15)], [(4, 107, 0, 0), (8, 37, 1, 38), (8, 20, 4, 21), (12, 11, 4, 12)], [(3, 115, 1, 116), (4, 40, 5, 41), (11, 16, 5, 17), (11, 12, 5, 13)], [(5, 87, 1, 88), (5, 41, 5, 42), (5, 24, 7, 25), (11, 12, 7, 13)], [(5, 98, 1, 99), (7, 45, 3, 46), (15, 19, 2, 20), (3, 15, 13, 16)], [(1, 107, 5, 108), (10, 46, 1, 47), (1, 22, 15, 23), (2, 14, 17, 15)], [(5, 120, 1, 121), (9, 43, 4, 44), (17, 22, 1, 23), (2, 14, 19, 15)], [(3, 113, 4, 114), (3, 44, 11, 45), (17, 21, 4, 22), (9, 13, 16, 14)], [(3, 107, 5, 108), (3, 41, 13, 42), (15, 24, 5, 25), (15, 15, 10, 16)], [(4, 116, 4, 117), (17, 42, 0, 0), (17, 22, 6, 23), (19, 16, 6, 17)], [(2, 111, 7, 112), (17, 46, 0, 0), (7, 24, 16, 25), (34, 13, 0, 0)], [(4, 121, 5, 122), (4, 47, 14, 48), (11, 24, 14, 25), (16, 15, 14, 16)], [(6, 117, 4, 118), (6, 45, 14, 46), (11, 24, 16, 25), (30, 16, 2, 17)], [(8, 106, 4, 107), (8, 47, 13, 48), (7, 24, 22, 25), (22, 15, 13, 16)], [(10, 114, 2, 115), (19, 46, 4, 47), (28, 22, 6, 23), (33, 16, 4, 17)], [(8, 122, 4, 123), (22, 45, 3, 46), (8, 23, 26, 24), (12, 15, 28, 16)], [(3, 117, 10, 118), (3, 45, 23, 46), (4, 24, 31, 25), (11, 15, 31, 16)], [(7, 116, 7, 117), (21, 45, 7, 46), (1, 23, 37, 24), (19, 15, 26, 16)], [(5, 115, 10, 116), (19, 47, 10, 48), (15, 24, 25, 25), (23, 15, 25, 16)], [(13, 115, 3, 116), (2, 46, 29, 47), (42, 24, 1, 25), (23, 15, 28, 16)], [(17, 115, 0, 0), (10, 46, 23, 47), (10, 24, 35, 25), (19, 15, 35, 16)], [(17, 115, 1, 116), (14, 46, 21, 47), (29, 24, 19, 25), (11, 15, 46, 16)], [(13, 115, 6, 116), (14, 46, 23, 47), (44, 24, 7, 25), (59, 16, 1, 17)], [(12, 121, 7, 122), (12, 47, 26, 48), (39, 24, 14, 25), (22, 15, 41, 16)], [(6, 121, 14, 122), (6, 47, 34, 48), (46, 24, 10, 25), (2, 15, 64, 16)], [(17, 122, 4, 123), (29, 46, 14, 47), (49, 24, 10, 25), (24, 15, 46, 16)], [(4, 122, 18, 123), (13, 46, 32, 47), (48, 24, 14, 25), (42, 15, 32, 16)], [(20, 117, 4, 118), (40, 47, 7, 48), (43, 24, 22, 25), (10, 15, 67, 16)], [(19, 118, 6, 119), (18, 47, 31, 48), (34, 24, 34, 25), (20, 15, 61, 16)] 42 | ] 43 | 44 | mode_indicator = {'numeric': '0001', 'alphanumeric': '0010', 'byte': '0100', 'kanji': '1000'} 45 | 46 | 47 | 48 | """ 49 | ****** for ECC.py ******* 50 | """ 51 | #GP: Generator Polynomial, MP: Message Polynomial 52 | GP_list = { 53 | 7: [0, 87, 229, 146, 149, 238, 102, 21], 54 | 10: [0, 251, 67, 46, 61, 118, 70, 64, 94, 32, 45], 55 | 13: [0, 74, 152, 176, 100, 86, 100, 106, 104, 130, 218, 206, 140, 78], 56 | 15: [0, 8, 183, 61, 91, 202, 37, 51, 58, 58, 237, 140, 124, 5, 99, 105], 57 | 16: [0, 120, 104, 107, 109, 102, 161, 76, 3, 91, 191, 147, 169, 182, 194, 225, 120], 58 | 17: [0, 43, 139, 206, 78, 43, 239, 123, 206, 214, 147, 24, 99, 150, 39, 243, 163, 136], 59 | 18: [0, 215, 234, 158, 94, 184, 97, 118, 170, 79, 187, 152, 148, 252, 179, 5, 98, 96, 153], 60 | 20: [0, 17, 60, 79, 50, 61, 163, 26, 187, 202, 180, 221, 225, 83, 239, 156, 164, 212, 212, 188, 190], 61 | 22: [0, 210, 171, 247, 242, 93, 230, 14, 109, 221, 53, 200, 74, 8, 172, 98, 80, 219, 134, 160, 105, 165, 231], 62 | 24: [0, 229, 121, 135, 48, 211, 117, 251, 126, 159, 180, 169, 152, 192, 226, 228, 218, 111, 0, 117, 232, 87, 96, 227, 21], 63 | 26: [0, 173, 125, 158, 2, 103, 182, 118, 17, 145, 201, 111, 28, 165, 53, 161, 21, 245, 142, 13, 102, 48, 227, 153, 145, 218, 70], 64 | 28: [0, 168, 223, 200, 104, 224, 234, 108, 180, 110, 190, 195, 147, 205, 27, 232, 201, 21, 43, 245, 87, 42, 195, 212, 119, 242, 37, 9, 123], 65 | 30: [0, 41, 173, 145, 152, 216, 31, 179, 182, 50, 48, 110, 86, 239, 96, 222, 125, 42, 173, 226, 193, 224, 130, 156, 37, 251, 216, 238, 40, 192, 180] 66 | } 67 | 68 | # Error Correction Codewords per block 69 | # [version1(level1,level2,level3,level4), 70 | # version2(..,..,..,..), 71 | # ....] 72 | ecc_num_per_block = [ 73 | (7, 10, 13, 17), (10, 16, 22, 28), (15, 26, 18, 22), (20, 18, 26, 16), (26, 24, 18, 22), (18, 16, 24, 28), (20, 18, 18, 26), (24, 22, 22, 26), (30, 22, 20, 24), (18, 26, 24, 28), (20, 30, 28, 24), (24, 22, 26, 28), (26, 22, 24, 22), (30, 24, 20, 24), (22, 24, 30, 24), (24, 28, 24, 30), (28, 28, 28, 28), (30, 26, 28, 28), (28, 26, 26, 26), (28, 26, 30, 28), (28, 26, 28, 30), (28, 28, 30, 24), (30, 28, 30, 30), (30, 28, 30, 30), (26, 28, 30, 30), (28, 28, 28, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30), (30, 28, 30, 30) 74 | ] 75 | 76 | 77 | # powers of 2 list 78 | po2 = [ 79 | 1, 2, 4, 8, 16, 32, 64, 128, 29, 58, 116, 232, 205, 135, 19, 38, 76, 152, 45, 90, 180, 117, 234, 201, 143, 3, 6, 12, 24, 48, 96, 192, 157, 39, 78, 156, 37, 74, 148, 53, 106, 212, 181, 119, 238, 193, 159, 35, 70, 140, 5, 10, 20, 40, 80, 160, 93, 186, 105, 210, 185, 111, 222, 161, 95, 190, 97, 194, 153, 47, 94, 188, 101, 202, 137, 15, 30, 60, 120, 240, 253, 231, 211, 187, 107, 214, 177, 127, 254, 225, 223, 163, 91, 182, 113, 226, 217, 175, 67, 134, 17, 34, 68, 136, 13, 26, 52, 104, 208, 189, 103, 206, 129, 31, 62, 124, 248, 237, 199, 147, 59, 118, 236, 197, 151, 51, 102, 204, 133, 23, 46, 92, 184, 109, 218, 169, 79, 158, 33, 66, 132, 21, 42, 84, 168, 77, 154, 41, 82, 164, 85, 170, 73, 146, 57, 114, 228, 213, 183, 115, 230, 209, 191, 99, 198, 145, 63, 126, 252, 229, 215, 179, 123, 246, 241, 255, 227, 219, 171, 75, 150, 49, 98, 196, 149, 55, 110, 220, 165, 87, 174, 65, 130, 25, 50, 100, 200, 141, 7, 14, 28, 56, 112, 224, 221, 167, 83, 166, 81, 162, 89, 178, 121, 242, 249, 239, 195, 155, 43, 86, 172, 69, 138, 9, 18, 36, 72, 144, 61, 122, 244, 245, 247, 243, 251, 235, 203, 139, 11, 22, 44, 88, 176, 125, 250, 233, 207, 131, 27, 54, 108, 216, 173, 71, 142, 1 80 | ] 81 | 82 | # log list 83 | log = [ 84 | None, 0, 1, 25, 2, 50, 26, 198, 3, 223, 51, 238, 27, 104, 199, 75, 4, 100, 224, 14, 52, 141, 239, 129, 28, 193, 105, 248, 200, 8, 76, 113, 5, 138, 101, 47, 225, 36, 15, 33, 53, 147, 142, 218, 240, 18, 130, 69, 29, 181, 194, 125, 106, 39, 249, 185, 201, 154, 9, 120, 77, 228, 114, 166, 6, 191, 139, 98, 102, 221, 48, 253, 226, 152, 37, 179, 16, 145, 34, 136, 54, 208, 148, 206, 143, 150, 219, 189, 241, 210, 19, 92, 131, 56, 70, 64, 30, 66, 182, 163, 195, 72, 126, 110, 107, 58, 40, 84, 250, 133, 186, 61, 202, 94, 155, 159, 10, 21, 121, 43, 78, 212, 229, 172, 115, 243, 167, 87, 7, 112, 192, 247, 140, 128, 99, 13, 103, 74, 222, 237, 49, 197, 254, 24, 227, 165, 153, 119, 38, 184, 180, 124, 17, 68, 146, 217, 35, 32, 137, 46, 55, 63, 209, 91, 149, 188, 207, 205, 144, 135, 151, 178, 220, 252, 190, 97, 242, 86, 211, 171, 20, 42, 93, 158, 132, 60, 57, 83, 71, 109, 65, 162, 31, 45, 67, 216, 183, 123, 164, 118, 196, 23, 73, 236, 127, 12, 111, 246, 108, 161, 59, 82, 41, 157, 85, 170, 251, 96, 134, 177, 187, 204, 62, 90, 203, 89, 95, 176, 156, 169, 160, 81, 11, 245, 22, 235, 122, 117, 44, 215, 79, 174, 213, 233, 230, 231, 173, 232, 116, 214, 244, 234, 168, 80, 88, 175 85 | ] 86 | 87 | """ 88 | ****** for data.py + ECC.py + structure.py + matrix.py ******* 89 | """ 90 | lindex = {'L':0, 'M':1, 'Q':2, 'H':3} 91 | 92 | """ 93 | ****** for structure.py ******* 94 | """ 95 | required_remainder_bits = (0,7,7,7,7,7,0,0,0,0,0,0,0,3,3,3,3,3,3,3,4,4,4,4,4,4,4,3,3,3,3,3,3,3,0,0,0,0,0,0) 96 | 97 | # [ 98 | # version1[ 99 | # level1(num_of_group_1_blocks, DC_per_group_1_block, num_of_group_2_blocks, DC_per_group_2_block), 100 | # level2(..,..,..,..), 101 | # level3(..,..,..,..), 102 | # level4(..,..,..,..) 103 | # ], 104 | # version2[level1(..), level2(..), level3(..), level4(..)], 105 | # ... 106 | # ] 107 | grouping_list = [ 108 | [(1, 19, 0, 0), (1, 16, 0, 0), (1, 13, 0, 0), (1, 9, 0, 0)], [(1, 34, 0, 0), (1, 28, 0, 0), (1, 22, 0, 0), (1, 16, 0, 0)], [(1, 55, 0, 0), (1, 44, 0, 0), (2, 17, 0, 0), (2, 13, 0, 0)], [(1, 80, 0, 0), (2, 32, 0, 0), (2, 24, 0, 0), (4, 9, 0, 0)], [(1, 108, 0, 0), (2, 43, 0, 0), (2, 15, 2, 16), (2, 11, 2, 12)], [(2, 68, 0, 0), (4, 27, 0, 0), (4, 19, 0, 0), (4, 15, 0, 0)], [(2, 78, 0, 0), (4, 31, 0, 0), (2, 14, 4, 15), (4, 13, 1, 14)], [(2, 97, 0, 0), (2, 38, 2, 39), (4, 18, 2, 19), (4, 14, 2, 15)], [(2, 116, 0, 0), (3, 36, 2, 37), (4, 16, 4, 17), (4, 12, 4, 13)], [(2, 68, 2, 69), (4, 43, 1, 44), (6, 19, 2, 20), (6, 15, 2, 16)], [(4, 81, 0, 0), (1, 50, 4, 51), (4, 22, 4, 23), (3, 12, 8, 13)], [(2, 92, 2, 93), (6, 36, 2, 37), (4, 20, 6, 21), (7, 14, 4, 15)], [(4, 107, 0, 0), (8, 37, 1, 38), (8, 20, 4, 21), (12, 11, 4, 12)], [(3, 115, 1, 116), (4, 40, 5, 41), (11, 16, 5, 17), (11, 12, 5, 13)], [(5, 87, 1, 88), (5, 41, 5, 42), (5, 24, 7, 25), (11, 12, 7, 13)], [(5, 98, 1, 99), (7, 45, 3, 46), (15, 19, 2, 20), (3, 15, 13, 16)], [(1, 107, 5, 108), (10, 46, 1, 47), (1, 22, 15, 23), (2, 14, 17, 15)], [(5, 120, 1, 121), (9, 43, 4, 44), (17, 22, 1, 23), (2, 14, 19, 15)], [(3, 113, 4, 114), (3, 44, 11, 45), (17, 21, 4, 22), (9, 13, 16, 14)], [(3, 107, 5, 108), (3, 41, 13, 42), (15, 24, 5, 25), (15, 15, 10, 16)], [(4, 116, 4, 117), (17, 42, 0, 0), (17, 22, 6, 23), (19, 16, 6, 17)], [(2, 111, 7, 112), (17, 46, 0, 0), (7, 24, 16, 25), (34, 13, 0, 0)], [(4, 121, 5, 122), (4, 47, 14, 48), (11, 24, 14, 25), (16, 15, 14, 16)], [(6, 117, 4, 118), (6, 45, 14, 46), (11, 24, 16, 25), (30, 16, 2, 17)], [(8, 106, 4, 107), (8, 47, 13, 48), (7, 24, 22, 25), (22, 15, 13, 16)], [(10, 114, 2, 115), (19, 46, 4, 47), (28, 22, 6, 23), (33, 16, 4, 17)], [(8, 122, 4, 123), (22, 45, 3, 46), (8, 23, 26, 24), (12, 15, 28, 16)], [(3, 117, 10, 118), (3, 45, 23, 46), (4, 24, 31, 25), (11, 15, 31, 16)], [(7, 116, 7, 117), (21, 45, 7, 46), (1, 23, 37, 24), (19, 15, 26, 16)], [(5, 115, 10, 116), (19, 47, 10, 48), (15, 24, 25, 25), (23, 15, 25, 16)], [(13, 115, 3, 116), (2, 46, 29, 47), (42, 24, 1, 25), (23, 15, 28, 16)], [(17, 115, 0, 0), (10, 46, 23, 47), (10, 24, 35, 25), (19, 15, 35, 16)], [(17, 115, 1, 116), (14, 46, 21, 47), (29, 24, 19, 25), (11, 15, 46, 16)], [(13, 115, 6, 116), (14, 46, 23, 47), (44, 24, 7, 25), (59, 16, 1, 17)], [(12, 121, 7, 122), (12, 47, 26, 48), (39, 24, 14, 25), (22, 15, 41, 16)], [(6, 121, 14, 122), (6, 47, 34, 48), (46, 24, 10, 25), (2, 15, 64, 16)], [(17, 122, 4, 123), (29, 46, 14, 47), (49, 24, 10, 25), (24, 15, 46, 16)], [(4, 122, 18, 123), (13, 46, 32, 47), (48, 24, 14, 25), (42, 15, 32, 16)], [(20, 117, 4, 118), (40, 47, 7, 48), (43, 24, 22, 25), (10, 15, 67, 16)], [(19, 118, 6, 119), (18, 47, 31, 48), (34, 24, 34, 25), (20, 15, 61, 16)] 109 | ] 110 | 111 | 112 | 113 | """ 114 | ****** for matrix.py ******* 115 | """ 116 | # Alignment Pattern Locations 117 | alig_location = [ 118 | (6, 18), (6, 22), (6, 26), (6, 30), (6, 34), (6, 22, 38), (6, 24, 42), (6, 26, 46), (6, 28, 50), (6, 30, 54), (6, 32, 58), (6, 34, 62), (6, 26, 46, 66), (6, 26, 48, 70), (6, 26, 50, 74), (6, 30, 54, 78), (6, 30, 56, 82), (6, 30, 58, 86), (6, 34, 62, 90), (6, 28, 50, 72, 94), (6, 26, 50, 74, 98), (6, 30, 54, 78, 102), (6, 28, 54, 80, 106), (6, 32, 58, 84, 110), (6, 30, 58, 86, 114), (6, 34, 62, 90, 118), (6, 26, 50, 74, 98, 122), (6, 30, 54, 78, 102, 126), (6, 26, 52, 78, 104, 130), (6, 30, 56, 82, 108, 134), (6, 34, 60, 86, 112, 138), (6, 30, 58, 86, 114, 142), (6, 34, 62, 90, 118, 146), (6, 30, 54, 78, 102, 126, 150), (6, 24, 50, 76, 102, 128, 154), (6, 28, 54, 80, 106, 132, 158), (6, 32, 58, 84, 110, 136, 162), (6, 26, 54, 82, 110, 138, 166), (6, 30, 58, 86, 114, 142, 170) 119 | ] 120 | 121 | # List of all Format Information Strings 122 | # [ 123 | # level1[mask_pattern0, mask_pattern1, mask_...3,...], 124 | # level2[...], 125 | # level3[...], 126 | # level4[...] 127 | # ] 128 | format_info_str = [ 129 | ['111011111000100', '111001011110011', '111110110101010', '111100010011101', '110011000101111', '110001100011000', '110110001000001', '110100101110110'], ['101010000010010', '101000100100101', '101111001111100', '101101101001011', '100010111111001', '100000011001110', '100111110010111', '100101010100000'], ['011010101011111', '011000001101000', '011111100110001', '011101000000110', '010010010110100', '010000110000011', '010111011011010', '010101111101101'], ['001011010001001', '001001110111110', '001110011100111', '001100111010000', '000011101100010', '000001001010101', '000110100001100', '000100000111011'] 130 | ] 131 | 132 | # Version Information Strings 133 | version_info_str = [ 134 | '000111110010010100', '001000010110111100', '001001101010011001', '001010010011010011', '001011101111110110', '001100011101100010', '001101100001000111', '001110011000001101', '001111100100101000', '010000101101111000', '010001010001011101', '010010101000010111', '010011010100110010', '010100100110100110', '010101011010000011', '010110100011001001', '010111011111101100', '011000111011000100', '011001000111100001', '011010111110101011', '011011000010001110', '011100110000011010', '011101001100111111', '011110110101110101', '011111001001010000', '100000100111010101', '100001011011110000', '100010100010111010', '100011011110011111', '100100101100001011', '100101010000101110', '100110101001100100', '100111010101000001', '101000110001101001' 135 | ] 136 | -------------------------------------------------------------------------------- /MyQR/mylibs/data.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from MyQR.mylibs.constant import char_cap, required_bytes, mindex, lindex, num_list, alphanum_list, grouping_list, mode_indicator 4 | 5 | # ecl: Error Correction Level(L,M,Q,H) 6 | def encode(ver, ecl, str): 7 | mode_encoding = { 8 | 'numeric': numeric_encoding, 9 | 'alphanumeric': alphanumeric_encoding, 10 | 'byte': byte_encoding, 11 | 'kanji': kanji_encoding 12 | } 13 | 14 | ver, mode = analyse(ver, ecl, str) 15 | 16 | print('line 16: mode:', mode) 17 | 18 | code = mode_indicator[mode] + get_cci(ver, mode, str) + mode_encoding[mode](str) 19 | 20 | # Add a Terminator 21 | rqbits = 8 * required_bytes[ver-1][lindex[ecl]] 22 | b = rqbits - len(code) 23 | code += '0000' if b >= 4 else '0' * b 24 | 25 | # Make the Length a Multiple of 8 26 | while len(code) % 8 != 0: 27 | code += '0' 28 | 29 | # Add Pad Bytes if the String is Still too Short 30 | while len(code) < rqbits: 31 | code += '1110110000010001' if rqbits - len(code) >= 16 else '11101100' 32 | 33 | data_code = [code[i:i+8] for i in range(len(code)) if i%8 == 0] 34 | data_code = [int(i,2) for i in data_code] 35 | 36 | g = grouping_list[ver-1][lindex[ecl]] 37 | data_codewords, i = [], 0 38 | for n in range(g[0]): 39 | data_codewords.append(data_code[i:i+g[1]]) 40 | i += g[1] 41 | for n in range(g[2]): 42 | data_codewords.append(data_code[i:i+g[3]]) 43 | i += g[3] 44 | 45 | return ver, data_codewords 46 | 47 | def analyse(ver, ecl, str): 48 | if all(i in num_list for i in str): 49 | mode = 'numeric' 50 | elif all(i in alphanum_list for i in str): 51 | mode = 'alphanumeric' 52 | else: 53 | mode = 'byte' 54 | 55 | m = mindex[mode] 56 | l = len(str) 57 | for i in range(40): 58 | if char_cap[ecl][i][m] > l: 59 | ver = i + 1 if i+1 > ver else ver 60 | break 61 | 62 | return ver, mode 63 | 64 | def numeric_encoding(str): 65 | str_list = [str[i:i+3] for i in range(0,len(str),3)] 66 | code = '' 67 | for i in str_list: 68 | rqbin_len = 10 69 | if len(i) == 1: 70 | rqbin_len = 4 71 | elif len(i) == 2: 72 | rqbin_len = 7 73 | code_temp = bin(int(i))[2:] 74 | code += ('0'*(rqbin_len - len(code_temp)) + code_temp) 75 | return code 76 | 77 | def alphanumeric_encoding(str): 78 | code_list = [alphanum_list.index(i) for i in str] 79 | code = '' 80 | for i in range(1, len(code_list), 2): 81 | c = bin(code_list[i-1] * 45 + code_list[i])[2:] 82 | c = '0'*(11-len(c)) + c 83 | code += c 84 | if i != len(code_list) - 1: 85 | c = bin(code_list[-1])[2:] 86 | c = '0'*(6-len(c)) + c 87 | code += c 88 | 89 | return code 90 | 91 | def byte_encoding(str): 92 | code = '' 93 | for i in str: 94 | c = bin(ord(i.encode('iso-8859-1')))[2:] 95 | c = '0'*(8-len(c)) + c 96 | code += c 97 | return code 98 | 99 | def kanji_encoding(str): 100 | pass 101 | 102 | # cci: character count indicator 103 | def get_cci(ver, mode, str): 104 | if 1 <= ver <= 9: 105 | cci_len = (10, 9, 8, 8)[mindex[mode]] 106 | elif 10 <= ver <= 26: 107 | cci_len = (12, 11, 16, 10)[mindex[mode]] 108 | else: 109 | cci_len = (14, 13, 16, 12)[mindex[mode]] 110 | 111 | cci = bin(len(str))[2:] 112 | cci = '0' * (cci_len - len(cci)) + cci 113 | return cci 114 | 115 | if __name__ == '__main__': 116 | s = '123456789' 117 | v, datacode = encode(1, 'H', s) 118 | print(v, datacode) -------------------------------------------------------------------------------- /MyQR/mylibs/draw.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from PIL import Image 4 | import os 5 | 6 | def draw_qrcode(abspath, qrmatrix): 7 | unit_len = 3 8 | x = y = 4*unit_len 9 | pic = Image.new('1', [(len(qrmatrix)+8)*unit_len]*2, 'white') 10 | 11 | for line in qrmatrix: 12 | for module in line: 13 | if module: 14 | draw_a_black_unit(pic, x, y, unit_len) 15 | x += unit_len 16 | x, y = 4*unit_len, y+unit_len 17 | 18 | saving = os.path.join(abspath, 'qrcode.png') 19 | pic.save(saving) 20 | return saving 21 | 22 | def draw_a_black_unit(p, x, y, ul): 23 | for i in range(ul): 24 | for j in range(ul): 25 | p.putpixel((x+i, y+j), 0) -------------------------------------------------------------------------------- /MyQR/mylibs/matrix.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from MyQR.mylibs.constant import alig_location, format_info_str, version_info_str, lindex 4 | 5 | def get_qrmatrix(ver, ecl, bits): 6 | num = (ver - 1) * 4 + 21 7 | qrmatrix = [[None] * num for i in range(num)] 8 | # [([None] * num * num)[i:i+num] for i in range(num * num) if i % num == 0] 9 | 10 | # Add the Finder Patterns & Add the Separators 11 | add_finder_and_separator(qrmatrix) 12 | 13 | # Add the Alignment Patterns 14 | add_alignment(ver, qrmatrix) 15 | 16 | # Add the Timing Patterns 17 | add_timing(qrmatrix) 18 | 19 | # Add the Dark Module and Reserved Areas 20 | add_dark_and_reserving(ver, qrmatrix) 21 | 22 | maskmatrix = [i[:] for i in qrmatrix] 23 | 24 | # Place the Data Bits 25 | place_bits(bits, qrmatrix) 26 | 27 | # Data Masking 28 | mask_num, qrmatrix = mask(maskmatrix, qrmatrix) 29 | 30 | # Format Information 31 | add_format_and_version_string(ver, ecl, mask_num, qrmatrix) 32 | 33 | return qrmatrix 34 | 35 | def add_finder_and_separator(m): 36 | for i in range(8): 37 | for j in range(8): 38 | if i in (0, 6): 39 | m[i][j] = m[-i-1][j] = m[i][-j-1] = 0 if j == 7 else 1 40 | elif i in (1, 5): 41 | m[i][j] = m[-i-1][j] = m[i][-j-1] = 1 if j in (0, 6) else 0 42 | elif i == 7: 43 | m[i][j] = m[-i-1][j] = m[i][-j-1] = 0 44 | else: 45 | m[i][j] = m[-i-1][j] = m[i][-j-1] = 0 if j in (1, 5, 7) else 1 46 | 47 | def add_alignment(ver, m): 48 | if ver > 1: 49 | coordinates = alig_location[ver-2] 50 | for i in coordinates: 51 | for j in coordinates: 52 | if m[i][j] is None: 53 | add_an_alignment(i, j, m) 54 | 55 | def add_an_alignment(row, column, m): 56 | for i in range(row-2, row+3): 57 | for j in range(column-2, column+3): 58 | m[i][j] = 1 if i in (row-2, row+2) or j in (column-2, column+2) else 0 59 | m[row][column] = 1 60 | 61 | def add_timing(m): 62 | for i in range(8, len(m)-8): 63 | m[i][6] = m[6][i] = 1 if i % 2 ==0 else 0 64 | 65 | def add_dark_and_reserving(ver, m): 66 | for j in range(8): 67 | m[8][j] = m[8][-j-1] = m[j][8] = m[-j-1][8] = 0 68 | m[8][8] = 0 69 | m[8][6] = m[6][8] = m[-8][8] = 1 70 | 71 | if ver > 6: 72 | for i in range(6): 73 | for j in (-9, -10, -11): 74 | m[i][j] = m[j][i] = 0 75 | 76 | def place_bits(bits, m): 77 | bit = (int(i) for i in bits) 78 | 79 | up = True 80 | for a in range(len(m)-1, 0, -2): 81 | a = a-1 if a <= 6 else a 82 | irange = range(len(m)-1, -1, -1) if up else range(len(m)) 83 | for i in irange: 84 | for j in (a, a-1): 85 | if m[i][j] is None: 86 | m[i][j] = next(bit) 87 | up = not up 88 | 89 | def mask(mm, m): 90 | mps = get_mask_patterns(mm) 91 | scores = [] 92 | for mp in mps: 93 | for i in range(len(mp)): 94 | for j in range(len(mp)): 95 | mp[i][j] = mp[i][j] ^ m[i][j] 96 | scores.append(compute_score(mp)) 97 | best = scores.index(min(scores)) 98 | return best, mps[best] 99 | 100 | def get_mask_patterns(mm): 101 | def formula(i, row, column): 102 | if i == 0: 103 | return (row + column) % 2 == 0 104 | elif i == 1: 105 | return row % 2 == 0 106 | elif i == 2: 107 | return column % 3 == 0 108 | elif i == 3: 109 | return (row + column) % 3 == 0 110 | elif i == 4: 111 | return (row // 2 + column // 3) % 2 == 0 112 | elif i == 5: 113 | return ((row * column) % 2) + ((row * column) % 3) == 0 114 | elif i == 6: 115 | return (((row * column) % 2) + ((row * column) % 3)) % 2 == 0 116 | elif i == 7: 117 | return (((row + column) % 2) + ((row * column) % 3)) % 2 == 0 118 | 119 | mm[-8][8] = None 120 | for i in range(len(mm)): 121 | for j in range(len(mm)): 122 | mm[i][j] = 0 if mm[i][j] is not None else mm[i][j] 123 | mps = [] 124 | for i in range(8): 125 | mp = [ii[:] for ii in mm] 126 | for row in range(len(mp)): 127 | for column in range(len(mp)): 128 | mp[row][column] = 1 if mp[row][column] is None and formula(i, row, column) else 0 129 | mps.append(mp) 130 | 131 | return mps 132 | 133 | def compute_score(m): 134 | def evaluation1(m): 135 | def ev1(ma): 136 | sc = 0 137 | for mi in ma: 138 | j = 0 139 | while j < len(mi)-4: 140 | n = 4 141 | while mi[j:j+n+1] in [[1]*(n+1), [0]*(n+1)]: 142 | n += 1 143 | (sc, j) = (sc+n-2, j+n) if n > 4 else (sc, j+1) 144 | return sc 145 | return ev1(m) + ev1(list(map(list, zip(*m)))) 146 | 147 | def evaluation2(m): 148 | sc = 0 149 | for i in range(len(m)-1): 150 | for j in range(len(m)-1): 151 | sc += 3 if m[i][j] == m[i+1][j] == m[i][j+1] == m[i+1][j+1] else 0 152 | return sc 153 | 154 | def evaluation3(m): 155 | def ev3(ma): 156 | sc = 0 157 | for mi in ma: 158 | j = 0 159 | while j < len(mi)-10: 160 | if mi[j:j+11] == [1,0,1,1,1,0,1,0,0,0,0]: 161 | sc += 40 162 | j += 7 163 | elif mi[j:j+11] == [0,0,0,0,1,0,1,1,1,0,1]: 164 | sc += 40 165 | j += 4 166 | else: 167 | j += 1 168 | return sc 169 | return ev3(m) + ev3(list(map(list, zip(*m)))) 170 | 171 | def evaluation4(m): 172 | darknum = 0 173 | for i in m: 174 | darknum += sum(i) 175 | percent = darknum / (len(m)**2) * 100 176 | s = int((50 - percent) / 5) * 5 177 | return 2*s if s >=0 else -2*s 178 | 179 | score = evaluation1(m) + evaluation2(m)+ evaluation3(m) + evaluation4(m) 180 | return score 181 | 182 | def add_format_and_version_string(ver, ecl, mask_num, m): 183 | fs = [int(i) for i in format_info_str[lindex[ecl]][mask_num]] 184 | for j in range(6): 185 | m[8][j] = m[-j-1][8] = fs[j] 186 | m[8][-j-1] = m[j][8] = fs[-j-1] 187 | m[8][7] = m[-7][8] = fs[6] 188 | m[8][8] = m[8][-8] = fs[7] 189 | m[7][8] = m[8][-7] = fs[8] 190 | 191 | if ver > 6: 192 | vs = (int(i) for i in version_info_str[ver-7]) 193 | for j in range(5, -1, -1): 194 | for i in (-9, -10, -11): 195 | m[i][j] = m[j][i] = next(vs) -------------------------------------------------------------------------------- /MyQR/mylibs/structure.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from MyQR.mylibs.constant import required_remainder_bits, lindex, grouping_list 4 | 5 | def structure_final_bits(ver, ecl, data_codewords, ecc): 6 | final_message = interleave_dc(ver, ecl, data_codewords) + interleave_ecc(ecc) 7 | 8 | # convert to binary & Add Remainder Bits if Necessary 9 | final_bits = ''.join(['0'*(8-len(i))+i for i in [bin(i)[2:] for i in final_message]]) + '0' * required_remainder_bits[ver-1] 10 | 11 | return final_bits 12 | 13 | def interleave_dc(ver, ecl, data_codewords): 14 | id = [] 15 | for t in zip(*data_codewords): 16 | id += list(t) 17 | g = grouping_list[ver-1][lindex[ecl]] 18 | if g[3]: 19 | for i in range(g[2]): 20 | id.append(data_codewords[i-g[2]][-1]) 21 | return id 22 | 23 | def interleave_ecc(ecc): 24 | ie = [] 25 | for t in zip(*ecc): 26 | ie += list(t) 27 | return ie -------------------------------------------------------------------------------- /MyQR/mylibs/theqrmodule.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from MyQR.mylibs import data, ECC, structure, matrix, draw 4 | 5 | # ver: Version from 1 to 40 6 | # ecl: Error Correction Level (L,M,Q,H) 7 | # get a qrcode picture of 3*3 pixels per module 8 | def get_qrcode(ver, ecl, str, save_place): 9 | # Data Coding 10 | ver, data_codewords = data.encode(ver, ecl, str) 11 | 12 | # Error Correction Coding 13 | ecc = ECC.encode(ver, ecl, data_codewords) 14 | 15 | # Structure final bits 16 | final_bits = structure.structure_final_bits(ver, ecl, data_codewords, ecc) 17 | 18 | # Get the QR Matrix 19 | qrmatrix = matrix.get_qrmatrix(ver, ecl, final_bits) 20 | 21 | # Draw the picture and Save it, then return the real ver and the absolute name 22 | return ver, draw.draw_qrcode(save_place, qrmatrix) 23 | -------------------------------------------------------------------------------- /MyQR/myqr.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | from MyQR.mylibs import theqrmodule 6 | from PIL import Image 7 | 8 | # Positional parameters 9 | # words: str 10 | # 11 | # Optional parameters 12 | # version: int, from 1 to 40 13 | # level: str, just one of ('L','M','Q','H') 14 | # picutre: str, a filename of a image 15 | # colorized: bool 16 | # constrast: float 17 | # brightness: float 18 | # save_name: str, the output filename like 'example.png' 19 | # save_dir: str, the output directory 20 | # 21 | # See [https://github.com/sylnsfar/qrcode] for more details! 22 | def run(words, version=1, level='H', picture=None, colorized=False, contrast=1.0, brightness=1.0, save_name=None, save_dir=os.getcwd()): 23 | 24 | supported_chars = r"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ··,.:;+-*/\~!@#$%^&`'=<>[]()?_{}|" 25 | 26 | 27 | # check every parameter 28 | if not isinstance(words, str): 29 | raise ValueError('Wrong words! Words must be a str instance!') 30 | if not isinstance(version, int) or version not in range(1, 41): 31 | raise ValueError('Wrong version! Please choose a int-type value from 1 to 40!') 32 | if not isinstance(level, str) or len(level)>1 or level not in 'LMQH': 33 | raise ValueError("Wrong level! Please choose a str-type level from {'L','M','Q','H'}!") 34 | if picture: 35 | if not isinstance(picture, str) or not os.path.isfile(picture) or picture[-4:] not in ('.jpg','.png','.bmp','.gif'): 36 | raise ValueError("Wrong picture! Input a filename that exists and be tailed with one of {'.jpg', '.png', '.bmp', '.gif'}!") 37 | if picture[-4:] == '.gif' and save_name and save_name[-4:] != '.gif': 38 | raise ValueError('Wrong save_name! If the picuter is .gif format, the output filename should be .gif format, too!') 39 | if not isinstance(colorized, bool): 40 | raise ValueError('Wrong colorized! Input a bool-type value!') 41 | if not isinstance(contrast, float): 42 | raise ValueError('Wrong contrast! Input a float-type value!') 43 | if not isinstance(brightness, float): 44 | raise ValueError('Wrong brightness! Input a float-type value!') 45 | if save_name and (not isinstance(save_name, str) or save_name[-4:] not in ('.jpg','.png','.bmp','.gif')): 46 | raise ValueError("Wrong save_name! Input a filename tailed with one of {'.jpg', '.png', '.bmp', '.gif'}!") 47 | if not os.path.isdir(save_dir): 48 | raise ValueError('Wrong save_dir! Input a existing-directory!') 49 | 50 | 51 | def combine(ver, qr_name, bg_name, colorized, contrast, brightness, save_dir, save_name=None): 52 | from MyQR.mylibs.constant import alig_location 53 | from PIL import ImageEnhance, ImageFilter 54 | 55 | qr = Image.open(qr_name) 56 | qr = qr.convert('RGBA') if colorized else qr 57 | 58 | bg0 = Image.open(bg_name).convert('RGBA') 59 | bg0 = ImageEnhance.Contrast(bg0).enhance(contrast) 60 | bg0 = ImageEnhance.Brightness(bg0).enhance(brightness) 61 | 62 | if bg0.size[0] < bg0.size[1]: 63 | bg0 = bg0.resize((qr.size[0]-24, (qr.size[0]-24)*int(bg0.size[1]/bg0.size[0]))) 64 | else: 65 | bg0 = bg0.resize(((qr.size[1]-24)*int(bg0.size[0]/bg0.size[1]), qr.size[1]-24)) 66 | 67 | bg = bg0 if colorized else bg0.convert('1') 68 | 69 | aligs = [] 70 | if ver > 1: 71 | aloc = alig_location[ver-2] 72 | for a in range(len(aloc)): 73 | for b in range(len(aloc)): 74 | if not ((a==b==0) or (a==len(aloc)-1 and b==0) or (a==0 and b==len(aloc)-1)): 75 | for i in range(3*(aloc[a]-2), 3*(aloc[a]+3)): 76 | for j in range(3*(aloc[b]-2), 3*(aloc[b]+3)): 77 | aligs.append((i,j)) 78 | 79 | for i in range(qr.size[0]-24): 80 | for j in range(qr.size[1]-24): 81 | if not ((i in (18,19,20)) or (j in (18,19,20)) or (i<24 and j<24) or (i<24 and j>qr.size[1]-49) or (i>qr.size[0]-49 and j<24) or ((i,j) in aligs) or (i%3==1 and j%3==1) or (bg0.getpixel((i,j))[3]==0)): 82 | qr.putpixel((i+12,j+12), bg.getpixel((i,j))) 83 | 84 | qr_name = os.path.join(save_dir, os.path.splitext(os.path.basename(bg_name))[0] + '_qrcode.png') if not save_name else os.path.join(save_dir, save_name) 85 | qr.resize((qr.size[0]*3, qr.size[1]*3)).save(qr_name) 86 | return qr_name 87 | 88 | tempdir = os.path.join(os.path.expanduser('~'), '.myqr') 89 | 90 | try: 91 | if not os.path.exists(tempdir): 92 | os.makedirs(tempdir) 93 | 94 | ver, qr_name = theqrmodule.get_qrcode(version, level, words, tempdir) 95 | 96 | if picture and picture[-4:]=='.gif': 97 | import imageio 98 | 99 | im = Image.open(picture) 100 | im.save(os.path.join(tempdir, '0.png')) 101 | while True: 102 | try: 103 | seq = im.tell() 104 | im.seek(seq + 1) 105 | im.save(os.path.join(tempdir, '%s.png' %(seq+1))) 106 | except EOFError: 107 | break 108 | 109 | imsname = [] 110 | for s in range(seq+1): 111 | bg_name = os.path.join(tempdir, '%s.png' % s) 112 | imsname.append(combine(ver, qr_name, bg_name, colorized, contrast, brightness, tempdir)) 113 | 114 | ims = [imageio.imread(pic) for pic in imsname] 115 | qr_name = os.path.join(save_dir, os.path.splitext(os.path.basename(picture))[0] + '_qrcode.gif') if not save_name else os.path.join(save_dir, save_name) 116 | imageio.mimsave(qr_name, ims) 117 | elif picture: 118 | qr_name = combine(ver, qr_name, picture, colorized, contrast, brightness, save_dir, save_name) 119 | elif qr_name: 120 | qr = Image.open(qr_name) 121 | qr_name = os.path.join(save_dir, os.path.basename(qr_name)) if not save_name else os.path.join(save_dir, save_name) 122 | qr.resize((qr.size[0]*3, qr.size[1]*3)).save(qr_name) 123 | 124 | return ver, level, qr_name 125 | 126 | except: 127 | raise 128 | finally: 129 | import shutil 130 | if os.path.exists(tempdir): 131 | shutil.rmtree(tempdir) -------------------------------------------------------------------------------- /MyQR/terminal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from MyQR.myqr import run 5 | import os 6 | 7 | def main(): 8 | import argparse 9 | argparser = argparse.ArgumentParser() 10 | argparser.add_argument('Words', help = 'The words to produce you QR-code picture, like a URL or a sentence. Please read the README file for the supported characters.') 11 | argparser.add_argument('-v', '--version', type = int, choices = range(1,41), default = 1, help = 'The version means the length of a side of the QR-Code picture. From little size to large is 1 to 40.') 12 | argparser.add_argument('-l', '--level', choices = list('LMQH'), default = 'H', help = 'Use this argument to choose an Error-Correction-Level: L(Low), M(Medium) or Q(Quartile), H(High). Otherwise, just use the default one: H') 13 | argparser.add_argument('-p', '--picture', help = 'the picture e.g. example.jpg') 14 | argparser.add_argument('-c', '--colorized', action = 'store_true', help = "Produce a colorized QR-Code with your picture. Just works when there is a correct '-p' or '--picture'.") 15 | argparser.add_argument('-con', '--contrast', type = float, default = 1.0, help = 'A floating point value controlling the enhancement of contrast. Factor 1.0 always returns a copy of the original image, lower factors mean less color (brightness, contrast, etc), and higher values more. There are no restrictions on this value. Default: 1.0') 16 | argparser.add_argument('-bri', '--brightness', type = float, default = 1.0, help = 'A floating point value controlling the enhancement of brightness. Factor 1.0 always returns a copy of the original image, lower factors mean less color (brightness, contrast, etc), and higher values more. There are no restrictions on this value. Default: 1.0') 17 | argparser.add_argument('-n', '--name', help = "The filename of output tailed with one of {'.jpg', '.png', '.bmp', '.gif'}. eg. exampl.png") 18 | argparser.add_argument('-d', '--directory', default = os.getcwd(), help = 'The directory of output.') 19 | args = argparser.parse_args() 20 | 21 | if args.picture and args.picture[-4:]=='.gif': 22 | print('It may take a while, please wait for minutes...') 23 | 24 | try: 25 | ver, ecl, qr_name = run( 26 | args.Words, 27 | args.version, 28 | args.level, 29 | args.picture, 30 | args.colorized, 31 | args.contrast, 32 | args.brightness, 33 | args.name, 34 | args.directory 35 | ) 36 | print('Succeed! \nCheck out your', str(ver) + '-' + str(ecl), 'QR-code:', qr_name) 37 | except: 38 | raise -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn awesome_qrcode:app --log-file=- 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # awesome-qrcode 2 | Generate Awesome QR Code in python, support text, static picture and GIF !!! 3 | -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__, static_url_path='/') 4 | 5 | from app import routes -------------------------------------------------------------------------------- /app/generator/__init__.py: -------------------------------------------------------------------------------- 1 | import base64 2 | import uuid 3 | from os import remove 4 | from os.path import isfile 5 | 6 | from MyQR import myqr 7 | 8 | 9 | def utf16to8(input_txt: str) -> str: 10 | out = [] 11 | for idx in range(len(input_txt)): 12 | ch = ord(input_txt[idx]) 13 | if 0x0001 <= ch <= 0x007f: 14 | out.append(input_txt[idx]) 15 | elif ch > 0x07ff: 16 | out.append(chr(0xE0 | (ch >> 12 & 0x0F))) 17 | out.append(chr(0x80 | (ch >> 6 & 0x3F))) 18 | out.append(chr(0x80 | (ch >> 0 & 0x3F))) 19 | else: 20 | out.append(chr(0xC0 | (ch >> 6) & 0x1f)) 21 | out.append(chr(0x80 | (ch >> 0) & 0x3f)) 22 | 23 | return ''.join(out) 24 | 25 | 26 | class Generator(object): 27 | @staticmethod 28 | def gen_normal_qrcode(text: str) -> str: 29 | target_filename = Generator._get_rnd_png_filename() 30 | version, level, qr_name = myqr.run(utf16to8(text), save_name=target_filename) 31 | result_str = None 32 | file = None 33 | try: 34 | file = open(qr_name, 'rb') 35 | result_str = base64.b64encode(file.read()) 36 | except Exception as e: 37 | print(e) 38 | finally: 39 | if file is not None: 40 | file.close() 41 | remove(qr_name) 42 | if isfile(target_filename): 43 | remove(target_filename) 44 | 45 | return str(result_str, 'utf-8') 46 | 47 | @staticmethod 48 | def gen_picture_qrcode(text: str, pic_file_path, colorized=True) -> str: 49 | target_filename = Generator._get_rnd_png_filename() 50 | version, level, qr_name = myqr.run(utf16to8(text), picture=pic_file_path, colorized=colorized, save_name=target_filename) 51 | result_str = None 52 | file = None 53 | try: 54 | file = open(qr_name, 'rb') 55 | result_str = base64.b64encode(file.read()) 56 | except Exception as e: 57 | print(e) 58 | finally: 59 | if file is not None: 60 | file.close() 61 | remove(qr_name) 62 | if isfile(pic_file_path): 63 | remove(pic_file_path) 64 | if isfile(target_filename): 65 | remove(target_filename) 66 | 67 | return str(result_str, 'utf-8') 68 | 69 | @staticmethod 70 | def gen_gif_qrcode(text: str, pic_file_path, colorized=True) -> str: 71 | target_filename = Generator._get_rnd_gif_filename() 72 | print(target_filename) 73 | result_str = None 74 | file = None 75 | 76 | try: 77 | version, level, qr_name = myqr.run(utf16to8(text), picture=pic_file_path, colorized=colorized, 78 | save_name=target_filename) 79 | file = open(qr_name, 'rb') 80 | result_str = base64.b64encode(file.read()) 81 | except Exception as e: 82 | print(e) 83 | finally: 84 | if file is not None: 85 | file.close() 86 | remove(target_filename) 87 | if isfile(pic_file_path): 88 | remove(pic_file_path) 89 | if isfile(target_filename): 90 | remove(target_filename) 91 | 92 | return str(result_str, 'utf-8') 93 | 94 | @staticmethod 95 | def _get_rnd_png_filename(): 96 | return str(uuid.uuid4()) + '.png' 97 | 98 | @staticmethod 99 | def _get_rnd_gif_filename(): 100 | return str(uuid.uuid4()) + '.gif' 101 | -------------------------------------------------------------------------------- /app/routes.py: -------------------------------------------------------------------------------- 1 | import os 2 | import uuid 3 | 4 | from flask import request, jsonify, render_template 5 | 6 | from app import app 7 | from app.generator import Generator 8 | 9 | 10 | @app.route('/') 11 | @app.route('/index') 12 | def index(): 13 | return render_template('index.html') 14 | 15 | 16 | @app.route('/qrcode/normal', methods=['POST']) 17 | def normal_qrcode(): 18 | text = request.json.get('text') 19 | try: 20 | result_base64 = Generator.gen_normal_qrcode(text) 21 | except Exception as e: 22 | return jsonify({ 23 | "code": 1, 24 | "message": e 25 | }) 26 | return jsonify({ 27 | "code": 0, 28 | "url": result_base64 29 | }) 30 | 31 | 32 | @app.route('/qrcode/picture', methods=['POST']) 33 | def picture_qrcode(): 34 | picture_file = request.files['file'] 35 | text = request.form['text'] 36 | temp_file_name = str(uuid.uuid1()) + '.' + picture_file.filename.split('.')[-1:][0].replace('jpeg', 'jpg') 37 | temp_file_path = os.path.join(os.getcwd(), temp_file_name) 38 | picture_file.save(temp_file_path) 39 | 40 | try: 41 | result_base64 = Generator.gen_picture_qrcode(text, temp_file_path) 42 | except Exception as e: 43 | return jsonify({ 44 | "code": 1, 45 | "message": e 46 | }) 47 | 48 | return jsonify({ 49 | "code": 0, 50 | "url": result_base64 51 | }) 52 | 53 | 54 | @app.route('/qrcode/gif', methods=['POST']) 55 | def gif_qrcode(): 56 | picture_file = request.files['file'] 57 | text = request.form['text'] 58 | temp_file_name = str(uuid.uuid4()) + '.' + picture_file.filename.split('.')[-1:][0] 59 | temp_file_path = os.path.join(os.getcwd(), temp_file_name) 60 | picture_file.save(temp_file_path) 61 | 62 | try: 63 | result_base64 = Generator.gen_gif_qrcode(text, temp_file_path) 64 | except Exception as e: 65 | return jsonify({ 66 | "code": 1, 67 | "message": e 68 | }) 69 | 70 | return jsonify({ 71 | "code": 0, 72 | "url": result_base64 73 | }) 74 | -------------------------------------------------------------------------------- /app/static/css/app.0f2a6adf.css: -------------------------------------------------------------------------------- 1 | div[data-v-5bd3282c],div[data-v-7bb66686],div[data-v-028efa8a],h3[data-v-5bd3282c],h3[data-v-7bb66686],h3[data-v-028efa8a]{text-align:left}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}body{margin:0} -------------------------------------------------------------------------------- /app/static/css/app.8374fd63.css: -------------------------------------------------------------------------------- 1 | i[data-v-b0566342],span[data-v-b0566342]{display:inline-block}i[data-v-b0566342]{margin-left:.5em}div[data-v-3f55d0cc],div[data-v-f56e9342],div[data-v-ffcbea00],h3[data-v-3f55d0cc],h3[data-v-f56e9342],h3[data-v-ffcbea00]{text-align:left}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}body{margin:0} -------------------------------------------------------------------------------- /app/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwenjian/awesome-qrcode/06ec717f03787897c37f2ab050161ac06b49529f/app/static/favicon.ico -------------------------------------------------------------------------------- /app/static/fonts/element-icons.535877f5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwenjian/awesome-qrcode/06ec717f03787897c37f2ab050161ac06b49529f/app/static/fonts/element-icons.535877f5.woff -------------------------------------------------------------------------------- /app/static/fonts/element-icons.732389de.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwenjian/awesome-qrcode/06ec717f03787897c37f2ab050161ac06b49529f/app/static/fonts/element-icons.732389de.ttf -------------------------------------------------------------------------------- /app/static/img/logo.528852a8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwenjian/awesome-qrcode/06ec717f03787897c37f2ab050161ac06b49529f/app/static/img/logo.528852a8.gif -------------------------------------------------------------------------------- /app/static/js/app.127c97bd.js: -------------------------------------------------------------------------------- 1 | (function(e){function t(t){for(var r,l,a=t[0],s=t[1],c=t[2],f=0,d=[];f0&&(e=".gif");var t=new Date,o="awesome-qrcode_".concat(t.getFullYear(),"_").concat(t.getMonth()+1,"_").concat(t.getDate(),"_").concat(t.getHours(),"_").concat(t.getMinutes(),"_").concat(t.getSeconds()).concat(e);this.saveAsImg(o,this.qrcode.url)},saveAsImg:function(e,t){var o=document.createElement("a");o.download=e,o.href=t;var r=navigator.userAgent,n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),i=r.match(/Edge\/([\d.]+)/);if("function"!==typeof MouseEvent||n||i)if(window.navigator.msSaveOrOpenBlob){var l=atob(t.split(",")[1]),a=l.length,s=new Uint8Array(a);while(a--)s[a]=l.charCodeAt(a);var c=new Blob([s]);window.navigator.msSaveOrOpenBlob(c,e)}else{var u='',f=window.open();f.document.write(u)}else{var d=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(d)}}}},y=M,C=Object(u["a"])(y,h,b,!1,null,null,null),R=C.exports,$=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("span",[o("span",[e._v("Text")]),o("el-tooltip",{attrs:{placement:"top"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")]),o("p",[e._v("4. Most Chinese characters!!!")])]),o("i",{staticClass:"el-icon-info"})])],1)},O=[],q={data:function(){return{}}},G=q,P=(o("f008"),Object(u["a"])(G,$,O,!1,null,"b0566342",null)),j=P.exports,k={components:{ResultDialog:R,TextFiledLabel:j},data:function(){return{formModel:{text:""},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}]},generating:!1}},methods:{generate:function(){var e=this;this.$refs["normal-form"].validate(function(t){!0===t&&e.$refs["result-dialog"].showNormal(e.formModel)})},onResultDialogClose:function(){this.formModel.text=null}}},D=k,E=(o("0e82"),Object(u["a"])(D,g,v,!1,null,"ffcbea00",null)),S=E.exports,T=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Picture QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"picture-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{prop:"text"}},[o("template",{slot:"label"},[o("TextFiledLabel")],1),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],2),o("el-form-item",{attrs:{label:"Background Picture",prop:"picFile"}},[o("el-upload",{ref:"pic-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/picture","on-change":e.onFileChange,accept:"image/jpeg, image/png, application/x-bmp","list-type":"picture","file-list":e.picFileList,limit:1}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .jpg/.png/.bmp file supported!")])])],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},L=[],Q={components:{ResultDialog:R,TextFiledLabel:j},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["picture-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showPicture(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["pic-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["picture-form"].validateField("picFile")):this.formModel.picFile=null}}},A=Q,N=(o("fb56"),Object(u["a"])(A,T,L,!1,null,"f56e9342",null)),B=N.exports,J=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Gif QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"gif-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{prop:"text"}},[o("template",{slot:"label"},[o("TextFiledLabel")],1),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],2),o("el-form-item",{attrs:{label:"Background Gif Picture",prop:"picFile"}},[o("el-upload",{ref:"gif-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/gif","on-change":e.onFileChange,accept:"image/gif","list-type":"picture","file-list":e.picFileList,limit:1}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .gif file supported!")])])],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},z=[],I={components:{ResultDialog:R,TextFiledLabel:j},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["gif-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showGif(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["gif-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["gif-form"].validateField("picFile")):this.formModel.picFile=null}}},H=I,U=(o("be22"),Object(u["a"])(H,J,z,!1,null,"3f55d0cc",null)),Y=U.exports,Z={name:"generator",components:{NormalGenerator:S,PictureGenerator:B,GifGenerator:Y},data:function(){return{activePane:"normal"}}},K=Z,V=Object(u["a"])(K,p,m,!1,null,null,null),W=V.exports,X={name:"app",components:{AppInfo:d,Generator:W}},ee=X,te=(o("034f"),Object(u["a"])(ee,n,i,!1,null,null,null)),oe=te.exports,re=o("5c96"),ne=o.n(re);o("0fae");r["default"].config.productionTip=!1,r["default"].use(ne.a),new r["default"]({render:function(e){return e(oe)}}).$mount("#app")},6451:function(e,t,o){},"64a9":function(e,t,o){},"7f69":function(e,t,o){},b734:function(e,t,o){},be22:function(e,t,o){"use strict";var r=o("6451"),n=o.n(r);n.a},f008:function(e,t,o){"use strict";var r=o("12a9"),n=o.n(r);n.a},fb56:function(e,t,o){"use strict";var r=o("7f69"),n=o.n(r);n.a}}); 2 | //# sourceMappingURL=app.127c97bd.js.map -------------------------------------------------------------------------------- /app/static/js/app.a53b71ff.js: -------------------------------------------------------------------------------- 1 | (function(e){function t(t){for(var r,i,a=t[0],s=t[1],c=t[2],p=0,f=[];p [ ] ( ) ? _ { } | and (space) ")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")])],1)],1),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},v=[],h=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{visible:e.visible,title:e.title,"close-on-press-escape":!1,"close-on-click-modal":!1,center:!0,"show-close":!1,width:"400px"}},[o("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.generating,expression:"generating"}]},[o("el-col",{attrs:{offset:4,span:16}},[o("img",{attrs:{src:e.qrcode.url,width:"100%"}})])],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.doClose}},[e._v("Close")]),o("el-button",{attrs:{type:"primary",disabled:!e.success},on:{click:e.doDownload}},[e._v("Download")])],1)],1)},b=[],_=o("bc3a"),x=function(e,t,o){_.post("/qrcode/normal",{text:e}).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},w=function(e,t,o){_.post("/qrcode/picture",e).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},C=function(e,t,o){_.post("/qrcode/gif",e).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},M={name:"result-dialog",data:function(){return{visible:!1,title:"Generating...",generating:!0,qrcode:{url:"https://http.cat/404"},success:!1}},methods:{showNormal:function(e){var t=this;this.visible=!0,this.generating=!0,x(e.text,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/png;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},showPicture:function(e){var t=this;this.visible=!0,this.generating=!0,w(e,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/png;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},showGif:function(e){var t=this;this.visible=!0,this.generating=!0,C(e,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/gif;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},doClose:function(){this.qrcode.url="https://http.cat/404",this.visible=!1,this.generating=!1,!0===this.success&&this.$emit("done")},doDownload:function(){}}},R=M,y=Object(u["a"])(R,h,b,!1,null,null,null),F=y.exports,$={components:{ResultDialog:F},data:function(){return{formModel:{text:""},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}]},generating:!1}},methods:{generate:function(){var e=this;this.$refs["normal-form"].validate(function(t){!0===t&&e.$refs["result-dialog"].showNormal(e.formModel)})},onResultDialogClose:function(){this.formModel.text=null}}},O=$,q=(o("0765"),Object(u["a"])(O,g,v,!1,null,"5bd3282c",null)),G=q.exports,P=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Picture QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"picture-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{label:"Text",prop:"text"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1),o("el-form-item",{attrs:{label:"Background Picture",prop:"picFile"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[e._v("1. Use a nearly square picture instead of a rectangle one.")])]),o("el-upload",{ref:"pic-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/picture","on-change":e.onFileChange,accept:"image/jpeg,image/png,application/x-bmp","list-type":"picture","file-list":e.picFileList}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .jpg/.png/.bmp file supported!")])])],1)],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},j=[],k={components:{ResultDialog:F},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["picture-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showPicture(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["pic-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["picture-form"].validateField("picFile")):this.formModel.picFile=null}}},D=k,S=(o("40a9"),Object(u["a"])(D,P,j,!1,null,"028efa8a",null)),E=S.exports,T=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Gif QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"gif-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{label:"Text",prop:"text"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1),o("el-form-item",{attrs:{label:"Background Gif Picture",prop:"picFile"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[e._v("1. Required.")]),o("p",[e._v("2. Must select a .gif file")])]),o("el-upload",{ref:"gif-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/gif","on-change":e.onFileChange,accept:"image/gif","list-type":"picture","file-list":e.picFileList}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .gif file supported!")])])],1)],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},N=[],Q={components:{ResultDialog:F},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["gif-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showGif(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["gif-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["gif-form"].validateField("picFile")):this.formModel.picFile=null}}},L=Q,z=(o("3ca5"),Object(u["a"])(L,T,N,!1,null,"7bb66686",null)),A=z.exports,J={name:"generator",components:{NormalGenerator:G,PictureGenerator:E,GifGenerator:A},data:function(){return{activePane:"normal"}}},Z=J,B=Object(u["a"])(Z,d,m,!1,null,null,null),I=B.exports,U={name:"app",components:{AppInfo:f,Generator:I}},H=U,K=(o("034f"),Object(u["a"])(H,n,l,!1,null,null,null)),V=K.exports,W=o("5c96"),X=o.n(W);o("0fae");r["default"].config.productionTip=!1,r["default"].use(X.a),new r["default"]({render:function(e){return e(V)}}).$mount("#app")},"64a9":function(e,t,o){},a6a6:function(e,t,o){}}); 2 | //# sourceMappingURL=app.a53b71ff.js.map -------------------------------------------------------------------------------- /app/static/js/app.a53b71ff.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/App.vue?4241","webpack:///./src/view/generators/NormalGenerator.vue?8b6d","webpack:///./src/assets/logo.gif","webpack:///./src/view/generators/GifGenerator.vue?005c","webpack:///./src/view/generators/PictureGenerator.vue?6469","webpack:///./src/App.vue?4ffe","webpack:///./src/view/AppInfo.vue?cc03","webpack:///src/view/AppInfo.vue","webpack:///./src/view/AppInfo.vue?1900","webpack:///./src/view/AppInfo.vue","webpack:///./src/view/Generator.vue?0ed9","webpack:///./src/view/generators/NormalGenerator.vue?8cbb","webpack:///./src/dialogs/ResultDialog.vue?e987","webpack:///./src/api/service.js","webpack:///src/dialogs/ResultDialog.vue","webpack:///./src/dialogs/ResultDialog.vue?109a","webpack:///./src/dialogs/ResultDialog.vue","webpack:///src/view/generators/NormalGenerator.vue","webpack:///./src/view/generators/NormalGenerator.vue?6b5e","webpack:///./src/view/generators/NormalGenerator.vue?8386","webpack:///./src/view/generators/PictureGenerator.vue?f4e3","webpack:///src/view/generators/PictureGenerator.vue","webpack:///./src/view/generators/PictureGenerator.vue?aa54","webpack:///./src/view/generators/PictureGenerator.vue?9587","webpack:///./src/view/generators/GifGenerator.vue?16b6","webpack:///src/view/generators/GifGenerator.vue","webpack:///./src/view/generators/GifGenerator.vue?60d3","webpack:///./src/view/generators/GifGenerator.vue?6504","webpack:///src/view/Generator.vue","webpack:///./src/view/Generator.vue?1235","webpack:///./src/view/Generator.vue","webpack:///src/App.vue","webpack:///./src/App.vue?c53a","webpack:///./src/App.vue?bff9","webpack:///./src/main.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","_vm","this","_h","$createElement","_c","_self","attrs","staticRenderFns","_m","_v","component","model","callback","$$v","activePane","expression","ref","formModel","formRule","slot","$set","on","generate","onResultDialogClose","visible","title","directives","rawName","qrcode","url","staticClass","doClose","success","doDownload","axios","require","get_normal_qrcode","text","cb","errCb","post","then","resp","code","catch","err","get_picture_qrcode","formData","get_gif_qrcode","generating","methods","showNormal","showPicture","showGif","$emit","components","ResultDialog","$refs","validate","valid","onFileChange","picFileList","picFile","required","message","append","clearFiles","fileList","file","validateField","NormalGenerator","PictureGenerator","GifGenerator","AppInfo","Generator","Vue","config","productionTip","use","ElementUI","render","h","App","$mount"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,EAAgBP,IAClBK,EAASG,KAAKD,EAAgBP,GAAS,IAExCO,EAAgBP,GAAW,EAE5B,IAAID,KAAYG,EACZO,OAAOC,UAAUC,eAAeC,KAAKV,EAAaH,KACpD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,KAAK4D,YAAc,GACnB5D,KAAKwD,MAAM,cAAcS,cAE3BN,aArBJ,SAqBA,KACWO,IACHlE,KAAKgB,UAAU6C,QAAU,MAEvBM,GACFnE,KAAKgB,UAAU6C,QAAUM,EACzBnE,KAAKwD,MAAM,YAAYY,cAAc,YAErCpE,KAAKgB,UAAU6C,QAAU,QCjHoR,ICQjT,G,UAAY,eACd,EACA,EACA,GACA,EACA,KACA,WACA,OAIa,I,QCEf,GACEvF,KAAM,YACNgF,WAAY,CACVe,gBAAJ,EACIC,iBAAJ,EACIC,aAAJ,GAEErI,KAPF,WAQI,MAAO,CACL2E,WAAY,YC9BoR,ICOlS,EAAY,eACd,EACA,EACA,GACA,EACA,KACA,KACA,MAIa,I,QCCf,GACEvC,KAAM,MACNgF,WAAY,CACVkB,QAAJ,EACIC,UAAJ,ICvBoR,ICQhR,G,UAAY,eACd,EACA,EACAnE,GACA,EACA,KACA,KACA,OAIa,I,uCCdfoE,aAAIC,OAAOC,eAAgB,EAE3BF,aAAIG,IAAIC,KAER,IAAIJ,aAAI,CACNK,OAAQ,SAAAC,GAAC,OAAIA,EAAEC,MACdC,OAAO,S","file":"js/app.a53b71ff.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"app\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([0,\"chunk-vendors\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=css&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NormalGenerator.vue?vue&type=style&index=0&id=5bd3282c&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NormalGenerator.vue?vue&type=style&index=0&id=5bd3282c&scoped=true&lang=css&\"","module.exports = __webpack_public_path__ + \"img/logo.528852a8.gif\";","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GifGenerator.vue?vue&type=style&index=0&id=7bb66686&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GifGenerator.vue?vue&type=style&index=0&id=7bb66686&scoped=true&lang=css&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PictureGenerator.vue?vue&type=style&index=0&id=028efa8a&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PictureGenerator.vue?vue&type=style&index=0&id=028efa8a&scoped=true&lang=css&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('el-row',[_c('el-col',{attrs:{\"offset\":4,\"span\":16}},[_c('app-info')],1)],1),_c('el-row',[_c('el-col',{attrs:{\"offset\":4,\"span\":16}},[_c('generator')],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('img',{attrs:{\"src\":require(\"../assets/logo.gif\"),\"alt\":\"Awesome QRCode\",\"width\":\"200px\"}}),_c('h1',[_vm._v(\"Awesome QR Code\")])])}]\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppInfo.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AppInfo.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AppInfo.vue?vue&type=template&id=60cfc32e&\"\nimport script from \"./AppInfo.vue?vue&type=script&lang=js&\"\nexport * from \"./AppInfo.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-tabs',{attrs:{\"type\":\"border-card\"},model:{value:(_vm.activePane),callback:function ($$v) {_vm.activePane=$$v},expression:\"activePane\"}},[_c('el-tab-pane',{attrs:{\"label\":\"Text\",\"name\":\"normal\"}},[_c('normal-generator')],1),_c('el-tab-pane',{attrs:{\"label\":\"Static Picture\",\"name\":\"picture\"}},[_c('picture-generator')],1),_c('el-tab-pane',{attrs:{\"label\":\"Gif\",\"name\":\"gif\"}},[_c('gif-generator')],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h3',[_vm._v(\"\\n Text QR Code Generator\\n \")]),_c('el-row',[_c('el-col',{attrs:{\"span\":14}},[_c('el-form',{ref:\"normal-form\",attrs:{\"model\":_vm.formModel,\"label-width\":\"150px\",\"label-position\":\"top\",\"rules\":_vm.formRule,\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":\"Text\",\"prop\":\"text\"}},[_c('el-tooltip',{attrs:{\"placement\":\"right\"}},[_c('div',{attrs:{\"slot\":\"content\"},slot:\"content\"},[_c('p',[_c('b',[_vm._v(\"Supported Characters:\")])]),_c('p',[_vm._v(\"1. Numbers: 0-9\")]),_c('p',[_vm._v(\"2. Letters: a-z, A-Z\")]),_c('p',[_vm._v(\"3. Common punctuations: · , . : ; + - * / \\\\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space) \")])]),_c('el-input',{model:{value:(_vm.formModel.text),callback:function ($$v) {_vm.$set(_vm.formModel, \"text\", $$v)},expression:\"formModel.text\"}})],1)],1)],1),_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.generate}},[_vm._v(\"Generate\")])],1)],1),_c('result-dialog',{ref:\"result-dialog\",on:{\"done\":_vm.onResultDialogClose}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{attrs:{\"visible\":_vm.visible,\"title\":_vm.title,\"close-on-press-escape\":false,\"close-on-click-modal\":false,\"center\":true,\"show-close\":false,\"width\":\"400px\"}},[_c('el-row',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.generating),expression:\"generating\"}]},[_c('el-col',{attrs:{\"offset\":4,\"span\":16}},[_c('img',{attrs:{\"src\":_vm.qrcode.url,\"width\":\"100%\"}})])],1),_c('span',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{on:{\"click\":_vm.doClose}},[_vm._v(\"Close\")]),_c('el-button',{attrs:{\"type\":\"primary\",\"disabled\":!_vm.success},on:{\"click\":_vm.doDownload}},[_vm._v(\"Download\")])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","const axios = require('axios')\n\nexport const get_normal_qrcode = function (text, cb, errCb) {\n axios.post('/qrcode/normal', {\n text: text\n }).then(resp => {\n let d = resp.data\n if (d.code === 0) {\n cb(resp.data)\n } else {\n errCb(resp.data)\n }\n }).catch(err => {\n errCb(err)\n })\n\n}\n\n\nexport const get_picture_qrcode = function (formData, cb, errCb) {\n axios.post('/qrcode/picture', formData).then(resp => {\n let d = resp.data\n if (d.code === 0) {\n cb(resp.data)\n } else {\n errCb(resp.data)\n }\n }).catch(err => {\n errCb(err)\n })\n\n}\n\nexport const get_gif_qrcode = function (formData, cb, errCb) {\n axios.post('/qrcode/gif', formData).then(resp => {\n let d = resp.data\n if (d.code === 0) {\n cb(resp.data)\n } else {\n errCb(resp.data)\n }\n }).catch(err => {\n errCb(err)\n })\n\n}\n","\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ResultDialog.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ResultDialog.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ResultDialog.vue?vue&type=template&id=86fbc016&\"\nimport script from \"./ResultDialog.vue?vue&type=script&lang=js&\"\nexport * from \"./ResultDialog.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NormalGenerator.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NormalGenerator.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./NormalGenerator.vue?vue&type=template&id=5bd3282c&scoped=true&\"\nimport script from \"./NormalGenerator.vue?vue&type=script&lang=js&\"\nexport * from \"./NormalGenerator.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NormalGenerator.vue?vue&type=style&index=0&id=5bd3282c&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5bd3282c\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h3',[_vm._v(\"Picture QR Code Generator\")]),_c('el-row',[_c('el-col',{attrs:{\"span\":14}},[_c('el-form',{ref:\"picture-form\",attrs:{\"model\":_vm.formModel,\"label-width\":\"150px\",\"label-position\":\"top\",\"rules\":_vm.formRule,\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":\"Text\",\"prop\":\"text\"}},[_c('el-tooltip',{attrs:{\"placement\":\"right\"}},[_c('div',{attrs:{\"slot\":\"content\"},slot:\"content\"},[_c('p',[_c('b',[_vm._v(\"Supported Characters:\")])]),_c('p',[_vm._v(\"1. Numbers: 0-9\")]),_c('p',[_vm._v(\"2. Letters: a-z, A-Z\")]),_c('p',[_vm._v(\"3. Common punctuations: · , . : ; + - * / \\\\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)\")])]),_c('el-input',{model:{value:(_vm.formModel.text),callback:function ($$v) {_vm.$set(_vm.formModel, \"text\", $$v)},expression:\"formModel.text\"}})],1)],1),_c('el-form-item',{attrs:{\"label\":\"Background Picture\",\"prop\":\"picFile\"}},[_c('el-tooltip',{attrs:{\"placement\":\"right\"}},[_c('div',{attrs:{\"slot\":\"content\"},slot:\"content\"},[_c('p',[_vm._v(\"1. Use a nearly square picture instead of a rectangle one.\")])]),_c('el-upload',{ref:\"pic-upload\",attrs:{\"drag\":\"\",\"auto-upload\":false,\"action\":\"/qrcode/picture\",\"on-change\":_vm.onFileChange,\"accept\":\"image/jpeg,image/png,application/x-bmp\",\"list-type\":\"picture\",\"file-list\":_vm.picFileList}},[_c('i',{staticClass:\"el-icon-upload\"}),_c('div',{staticClass:\"el-upload__text\"},[_vm._v(\"\\n Drop your image file here,or\\n \"),_c('em',[_vm._v(\"Click to upload\")])]),_c('div',{staticClass:\"el-upload__tip\",attrs:{\"slot\":\"tip\"},slot:\"tip\"},[_vm._v(\"Only .jpg/.png/.bmp file supported!\")])])],1)],1)],1)],1)],1),_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.generate}},[_vm._v(\"Generate\")]),_c('result-dialog',{ref:\"result-dialog\",on:{\"done\":_vm.onResultDialogClose}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PictureGenerator.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PictureGenerator.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PictureGenerator.vue?vue&type=template&id=028efa8a&scoped=true&\"\nimport script from \"./PictureGenerator.vue?vue&type=script&lang=js&\"\nexport * from \"./PictureGenerator.vue?vue&type=script&lang=js&\"\nimport style0 from \"./PictureGenerator.vue?vue&type=style&index=0&id=028efa8a&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"028efa8a\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h3',[_vm._v(\"Gif QR Code Generator\")]),_c('el-row',[_c('el-col',{attrs:{\"span\":14}},[_c('el-form',{ref:\"gif-form\",attrs:{\"model\":_vm.formModel,\"label-width\":\"150px\",\"label-position\":\"top\",\"rules\":_vm.formRule,\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":\"Text\",\"prop\":\"text\"}},[_c('el-tooltip',{attrs:{\"placement\":\"right\"}},[_c('div',{attrs:{\"slot\":\"content\"},slot:\"content\"},[_c('p',[_c('b',[_vm._v(\"Supported Characters:\")])]),_c('p',[_vm._v(\"1. Numbers: 0-9\")]),_c('p',[_vm._v(\"2. Letters: a-z, A-Z\")]),_c('p',[_vm._v(\"3. Common punctuations: · , . : ; + - * / \\\\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)\")])]),_c('el-input',{model:{value:(_vm.formModel.text),callback:function ($$v) {_vm.$set(_vm.formModel, \"text\", $$v)},expression:\"formModel.text\"}})],1)],1),_c('el-form-item',{attrs:{\"label\":\"Background Gif Picture\",\"prop\":\"picFile\"}},[_c('el-tooltip',{attrs:{\"placement\":\"right\"}},[_c('div',{attrs:{\"slot\":\"content\"},slot:\"content\"},[_c('p',[_vm._v(\"1. Required.\")]),_c('p',[_vm._v(\"2. Must select a .gif file\")])]),_c('el-upload',{ref:\"gif-upload\",attrs:{\"drag\":\"\",\"auto-upload\":false,\"action\":\"/qrcode/gif\",\"on-change\":_vm.onFileChange,\"accept\":\"image/gif\",\"list-type\":\"picture\",\"file-list\":_vm.picFileList}},[_c('i',{staticClass:\"el-icon-upload\"}),_c('div',{staticClass:\"el-upload__text\"},[_vm._v(\"\\n Drop your image file here,or\\n \"),_c('em',[_vm._v(\"Click to upload\")])]),_c('div',{staticClass:\"el-upload__tip\",attrs:{\"slot\":\"tip\"},slot:\"tip\"},[_vm._v(\"Only .gif file supported!\")])])],1)],1)],1)],1)],1),_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.generate}},[_vm._v(\"Generate\")]),_c('result-dialog',{ref:\"result-dialog\",on:{\"done\":_vm.onResultDialogClose}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GifGenerator.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GifGenerator.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./GifGenerator.vue?vue&type=template&id=7bb66686&scoped=true&\"\nimport script from \"./GifGenerator.vue?vue&type=script&lang=js&\"\nexport * from \"./GifGenerator.vue?vue&type=script&lang=js&\"\nimport style0 from \"./GifGenerator.vue?vue&type=style&index=0&id=7bb66686&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7bb66686\",\n null\n \n)\n\nexport default component.exports","\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Generator.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Generator.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Generator.vue?vue&type=template&id=71f5c438&\"\nimport script from \"./Generator.vue?vue&type=script&lang=js&\"\nexport * from \"./Generator.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=466692e9&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue'\nimport App from './App.vue'\nimport ElementUI from 'element-ui'\nimport 'element-ui/lib/theme-chalk/index.css'\n\nVue.config.productionTip = false\n\nVue.use(ElementUI)\n\nnew Vue({\n render: h => h(App),\n}).$mount('#app')\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /app/static/js/app.aef7f405.js: -------------------------------------------------------------------------------- 1 | (function(e){function t(t){for(var r,i,l=t[0],s=t[1],c=t[2],p=0,d=[];p [ ] ( ) ? _ { } | and (space) ")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")])],1)],1),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},v=[],h=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{visible:e.visible,title:e.title,"close-on-press-escape":!1,"close-on-click-modal":!1,center:!0,"show-close":!1,width:"400px"}},[o("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.generating,expression:"generating"}]},[o("el-col",{attrs:{offset:4,span:16}},[o("img",{attrs:{src:e.qrcode.url,width:"100%"}})])],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.doClose}},[e._v("Close")]),o("el-button",{attrs:{type:"primary",disabled:!e.success},on:{click:e.doDownload}},[e._v("Download")])],1)],1)},b=[],_=(o("34ef"),o("28a5"),o("4917"),o("bc3a")),x=function(e,t,o){_.post("/qrcode/normal",{text:e}).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},w=function(e,t,o){_.post("/qrcode/picture",e).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},M=function(e,t,o){_.post("/qrcode/gif",e).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},y={name:"result-dialog",data:function(){return{visible:!1,title:"Generating...",generating:!0,qrcode:{url:"https://http.cat/404"},success:!1}},methods:{showNormal:function(e){var t=this;this.visible=!0,this.generating=!0,x(e.text,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/png;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},showPicture:function(e){var t=this;this.visible=!0,this.generating=!0,w(e,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/png;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},showGif:function(e){var t=this;this.visible=!0,this.generating=!0,M(e,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/gif;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},doClose:function(){this.qrcode.url="https://http.cat/404",this.visible=!1,this.generating=!1,!0===this.success&&this.$emit("done")},doDownload:function(){var e=".png";this.qrcode.url.indexOf("image/gif")>0&&(e=".gif");var t=new Date,o="awesome-qrcode_".concat(t.getFullYear(),"_").concat(t.getMonth()+1,"_").concat(t.getDate(),"_").concat(t.getHours(),"_").concat(t.getMinutes(),"_").concat(t.getSeconds()).concat(e);this.saveAsImg(o,this.qrcode.url)},saveAsImg:function(e,t){var o=document.createElement("a");o.download=e,o.href=t;var r=navigator.userAgent,n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge\/([\d.]+)/);if("function"!==typeof MouseEvent||n||a)if(window.navigator.msSaveOrOpenBlob){var i=atob(t.split(",")[1]),l=i.length,s=new Uint8Array(l);while(l--)s[l]=i.charCodeAt(l);var c=new Blob([s]);window.navigator.msSaveOrOpenBlob(c,e)}else{var u='',p=window.open();p.document.write(u)}else{var d=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(d)}}}},C=y,F=Object(u["a"])(C,h,b,!1,null,null,null),R=F.exports,$={components:{ResultDialog:R},data:function(){return{formModel:{text:""},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}]},generating:!1}},methods:{generate:function(){var e=this;this.$refs["normal-form"].validate(function(t){!0===t&&e.$refs["result-dialog"].showNormal(e.formModel)})},onResultDialogClose:function(){this.formModel.text=null}}},O=$,q=(o("0765"),Object(u["a"])(O,g,v,!1,null,"5bd3282c",null)),G=q.exports,P=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Picture QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"picture-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{label:"Text",prop:"text"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1),o("el-form-item",{attrs:{label:"Background Picture",prop:"picFile"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[e._v("1. Use a nearly square picture instead of a rectangle one.")])]),o("el-upload",{ref:"pic-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/picture","on-change":e.onFileChange,accept:"image/jpeg,image/png,application/x-bmp","list-type":"picture","file-list":e.picFileList}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .jpg/.png/.bmp file supported!")])])],1)],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},S=[],k={components:{ResultDialog:R},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["picture-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showPicture(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["pic-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["picture-form"].validateField("picFile")):this.formModel.picFile=null}}},D=k,j=(o("40a9"),Object(u["a"])(D,P,S,!1,null,"028efa8a",null)),E=j.exports,T=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Gif QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"gif-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{label:"Text",prop:"text"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1),o("el-form-item",{attrs:{label:"Background Gif Picture",prop:"picFile"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[e._v("1. Required.")]),o("p",[e._v("2. Must select a .gif file")])]),o("el-upload",{ref:"gif-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/gif","on-change":e.onFileChange,accept:"image/gif","list-type":"picture","file-list":e.picFileList}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .gif file supported!")])])],1)],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},A=[],N={components:{ResultDialog:R},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["gif-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showGif(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["gif-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["gif-form"].validateField("picFile")):this.formModel.picFile=null}}},Q=N,L=(o("3ca5"),Object(u["a"])(Q,T,A,!1,null,"7bb66686",null)),z=L.exports,B={name:"generator",components:{NormalGenerator:G,PictureGenerator:E,GifGenerator:z},data:function(){return{activePane:"normal"}}},J=B,I=Object(u["a"])(J,f,m,!1,null,null,null),Z=I.exports,U={name:"app",components:{AppInfo:d,Generator:Z}},H=U,Y=(o("034f"),Object(u["a"])(H,n,a,!1,null,null,null)),K=Y.exports,V=o("5c96"),W=o.n(V);o("0fae");r["default"].config.productionTip=!1,r["default"].use(W.a),new r["default"]({render:function(e){return e(K)}}).$mount("#app")},"64a9":function(e,t,o){},a6a6:function(e,t,o){}}); 2 | //# sourceMappingURL=app.aef7f405.js.map -------------------------------------------------------------------------------- /app/static/js/app.b795e18d.js: -------------------------------------------------------------------------------- 1 | (function(e){function t(t){for(var r,i,l=t[0],s=t[1],c=t[2],p=0,d=[];p [ ] ( ) ? _ { } | and (space) ")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")])],1)],1),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},v=[],h=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{visible:e.visible,title:e.title,"close-on-press-escape":!1,"close-on-click-modal":!1,center:!0,"show-close":!1,width:"400px"}},[o("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.generating,expression:"generating"}]},[o("el-col",{attrs:{offset:4,span:16}},[o("img",{attrs:{src:e.qrcode.url,width:"100%"}})])],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.doClose}},[e._v("Close")]),o("el-button",{attrs:{type:"primary",disabled:!e.success},on:{click:e.doDownload}},[e._v("Download")])],1)],1)},b=[],_=(o("34ef"),o("28a5"),o("4917"),o("bc3a")),x=function(e,t,o){_.post("/qrcode/normal",{text:e}).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},w=function(e,t,o){_.post("/qrcode/picture",e).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},M=function(e,t,o){_.post("/qrcode/gif",e).then(function(e){var r=e.data;0===r.code?t(e.data):o(e.data)}).catch(function(e){o(e)})},y={name:"result-dialog",data:function(){return{visible:!1,title:"Generating...",generating:!0,qrcode:{url:"https://http.cat/404"},success:!1}},methods:{showNormal:function(e){var t=this;this.visible=!0,this.generating=!0,x(e.text,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/png;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},showPicture:function(e){var t=this;this.visible=!0,this.generating=!0,w(e,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/png;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},showGif:function(e){var t=this;this.visible=!0,this.generating=!0,M(e,function(e){t.success=!0,t.title="Generate succeed!",t.$message.success("Success!"),t.qrcode.url="data:image/gif;base64,"+e.url,t.generating=!1},function(e){t.$message.error("ERROR! "+JSON.stringify(e))})},doClose:function(){this.qrcode.url="https://http.cat/404",this.visible=!1,this.generating=!1,!0===this.success&&this.$emit("done")},doDownload:function(){var e=".png";this.qrcode.url.indexOf("image/gif")>0&&(e=".gif");var t=new Date,o="awesome-qrcode_".concat(t.getFullYear(),"_").concat(t.getMonth(),"_").concat(t.getDate(),"_").concat(t.getHours(),"_").concat(t.getMinutes(),"_").concat(t.getSeconds()).concat(e);this.saveAsImg(o,this.qrcode.url)},saveAsImg:function(e,t){var o=document.createElement("a");o.download=e,o.href=t;var r=navigator.userAgent,n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge\/([\d.]+)/);if("function"!==typeof MouseEvent||n||a)if(window.navigator.msSaveOrOpenBlob){var i=atob(t.split(",")[1]),l=i.length,s=new Uint8Array(l);while(l--)s[l]=i.charCodeAt(l);var c=new Blob([s]);window.navigator.msSaveOrOpenBlob(c,e)}else{var u='',p=window.open();p.document.write(u)}else{var d=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(d)}}}},C=y,F=Object(u["a"])(C,h,b,!1,null,null,null),R=F.exports,$={components:{ResultDialog:R},data:function(){return{formModel:{text:""},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}]},generating:!1}},methods:{generate:function(){var e=this;this.$refs["normal-form"].validate(function(t){!0===t&&e.$refs["result-dialog"].showNormal(e.formModel)})},onResultDialogClose:function(){this.formModel.text=null}}},O=$,q=(o("0765"),Object(u["a"])(O,g,v,!1,null,"5bd3282c",null)),G=q.exports,P=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Picture QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"picture-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{label:"Text",prop:"text"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1),o("el-form-item",{attrs:{label:"Background Picture",prop:"picFile"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[e._v("1. Use a nearly square picture instead of a rectangle one.")])]),o("el-upload",{ref:"pic-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/picture","on-change":e.onFileChange,accept:"image/jpeg,image/png,application/x-bmp","list-type":"picture","file-list":e.picFileList}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .jpg/.png/.bmp file supported!")])])],1)],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},S=[],k={components:{ResultDialog:R},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["picture-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showPicture(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["pic-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["picture-form"].validateField("picFile")):this.formModel.picFile=null}}},D=k,j=(o("40a9"),Object(u["a"])(D,P,S,!1,null,"028efa8a",null)),E=j.exports,T=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Gif QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"gif-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{label:"Text",prop:"text"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")])]),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],1)],1),o("el-form-item",{attrs:{label:"Background Gif Picture",prop:"picFile"}},[o("el-tooltip",{attrs:{placement:"right"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[e._v("1. Required.")]),o("p",[e._v("2. Must select a .gif file")])]),o("el-upload",{ref:"gif-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/gif","on-change":e.onFileChange,accept:"image/gif","list-type":"picture","file-list":e.picFileList}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .gif file supported!")])])],1)],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},A=[],N={components:{ResultDialog:R},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["gif-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showGif(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["gif-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["gif-form"].validateField("picFile")):this.formModel.picFile=null}}},Q=N,L=(o("3ca5"),Object(u["a"])(Q,T,A,!1,null,"7bb66686",null)),z=L.exports,B={name:"generator",components:{NormalGenerator:G,PictureGenerator:E,GifGenerator:z},data:function(){return{activePane:"normal"}}},J=B,I=Object(u["a"])(J,f,m,!1,null,null,null),Z=I.exports,U={name:"app",components:{AppInfo:d,Generator:Z}},H=U,Y=(o("034f"),Object(u["a"])(H,n,a,!1,null,null,null)),K=Y.exports,V=o("5c96"),W=o.n(V);o("0fae");r["default"].config.productionTip=!1,r["default"].use(W.a),new r["default"]({render:function(e){return e(K)}}).$mount("#app")},"64a9":function(e,t,o){},a6a6:function(e,t,o){}}); 2 | //# sourceMappingURL=app.b795e18d.js.map -------------------------------------------------------------------------------- /app/static/js/app.f8838470.js: -------------------------------------------------------------------------------- 1 | (function(e){function t(t){for(var r,l,a=t[0],s=t[1],c=t[2],f=0,d=[];f0&&(e=".gif");var t=new Date,o="awesome-qrcode_".concat(t.getFullYear(),"_").concat(t.getMonth()+1,"_").concat(t.getDate(),"_").concat(t.getHours(),"_").concat(t.getMinutes(),"_").concat(t.getSeconds()).concat(e);this.saveAsImg(o,this.qrcode.url)},saveAsImg:function(e,t){var o=document.createElement("a");o.download=e,o.href=t;var r=navigator.userAgent,n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),i=r.match(/Edge\/([\d.]+)/);if("function"!==typeof MouseEvent||n||i)if(window.navigator.msSaveOrOpenBlob){var l=atob(t.split(",")[1]),a=l.length,s=new Uint8Array(a);while(a--)s[a]=l.charCodeAt(a);var c=new Blob([s]);window.navigator.msSaveOrOpenBlob(c,e)}else{var u='',f=window.open();f.document.write(u)}else{var d=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(d)}}}},y=M,C=Object(u["a"])(y,h,b,!1,null,null,null),R=C.exports,$=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("span",[o("span",[e._v("Text")]),o("el-tooltip",{attrs:{placement:"top"}},[o("div",{attrs:{slot:"content"},slot:"content"},[o("p",[o("b",[e._v("Supported Characters:")])]),o("p",[e._v("1. Numbers: 0-9")]),o("p",[e._v("2. Letters: a-z, A-Z")]),o("p",[e._v("3. Common punctuations: · , . : ; + - * / \\ ~ ! @ # $ % ^ & ` ' = < > [ ] ( ) ? _ { } | and (space)")]),o("p",[e._v("4. Most Chinese characters!!!")])]),o("i",{staticClass:"el-icon-info"})])],1)},O=[],q={data:function(){return{}}},G=q,P=(o("f008"),Object(u["a"])(G,$,O,!1,null,"b0566342",null)),j=P.exports,k={components:{ResultDialog:R,TextFiledLabel:j},data:function(){return{formModel:{text:""},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}]},generating:!1}},methods:{generate:function(){var e=this;this.$refs["normal-form"].validate(function(t){!0===t&&e.$refs["result-dialog"].showNormal(e.formModel)})},onResultDialogClose:function(){this.formModel.text=null}}},D=k,E=(o("0e82"),Object(u["a"])(D,g,v,!1,null,"ffcbea00",null)),S=E.exports,T=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Picture QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"picture-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{prop:"text"}},[o("template",{slot:"label"},[o("TextFiledLabel")],1),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],2),o("el-form-item",{attrs:{label:"Background Picture",prop:"picFile"}},[o("el-upload",{ref:"pic-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/picture","on-change":e.onFileChange,accept:"image/jpeg, image/png, application/x-bmp","list-type":"picture","file-list":e.picFileList,limit:1}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .jpg/.png/.bmp file supported!")])])],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},L=[],Q={components:{ResultDialog:R,TextFiledLabel:j},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["picture-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showPicture(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["pic-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["picture-form"].validateField("picFile")):this.formModel.picFile=null}}},A=Q,N=(o("fb56"),Object(u["a"])(A,T,L,!1,null,"f56e9342",null)),B=N.exports,J=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("h3",[e._v("Gif QR Code Generator")]),o("el-row",[o("el-col",{attrs:{span:14}},[o("el-form",{ref:"gif-form",attrs:{model:e.formModel,"label-width":"150px","label-position":"top",rules:e.formRule,size:"small"}},[o("el-form-item",{attrs:{prop:"text"}},[o("template",{slot:"label"},[o("TextFiledLabel")],1),o("el-input",{model:{value:e.formModel.text,callback:function(t){e.$set(e.formModel,"text",t)},expression:"formModel.text"}})],2),o("el-form-item",{attrs:{label:"Background Gif Picture",prop:"picFile"}},[o("el-upload",{ref:"gif-upload",attrs:{drag:"","auto-upload":!1,action:"/qrcode/gif","on-change":e.onFileChange,accept:"image/gif","list-type":"picture","file-list":e.picFileList,limit:1}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[e._v("\n Drop your image file here,or\n "),o("em",[e._v("Click to upload")])]),o("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("Only .gif file supported!")])])],1)],1)],1)],1),o("el-button",{attrs:{type:"primary"},on:{click:e.generate}},[e._v("Generate")]),o("result-dialog",{ref:"result-dialog",on:{done:e.onResultDialogClose}})],1)},z=[],I={components:{ResultDialog:R,TextFiledLabel:j},data:function(){return{formModel:{text:"",picFile:null},formRule:{text:[{required:!0,message:"Text is required to generate QR Code!"}],picFile:{required:!0,message:"Picture file is required to generate QR Code!"}},picFileList:[]}},methods:{generate:function(){var e=this;this.$refs["gif-form"].validate(function(t){if(!0===t){var o=new FormData;o.append("text",e.formModel.text),o.append("file",e.formModel.picFile.raw),e.$refs["result-dialog"].showGif(o)}})},onResultDialogClose:function(){this.formModel.text=null,this.formModel.picFile=null,this.picFileList=[],this.$refs["gif-upload"].clearFiles()},onFileChange:function(e,t){t||(this.formModel.picFile=null),e?(this.formModel.picFile=e,this.$refs["gif-form"].validateField("picFile")):this.formModel.picFile=null}}},H=I,U=(o("be22"),Object(u["a"])(H,J,z,!1,null,"3f55d0cc",null)),Y=U.exports,Z={name:"generator",components:{NormalGenerator:S,PictureGenerator:B,GifGenerator:Y},data:function(){return{activePane:"normal"}}},K=Z,V=Object(u["a"])(K,p,m,!1,null,null,null),W=V.exports,X={name:"app",components:{AppInfo:d,Generator:W}},ee=X,te=(o("034f"),Object(u["a"])(ee,n,i,!1,null,null,null)),oe=te.exports,re=o("5c96"),ne=o.n(re);o("0fae");r["default"].config.productionTip=!1,r["default"].use(ne.a),new r["default"]({render:function(e){return e(oe)}}).$mount("#app")},6451:function(e,t,o){},"64a9":function(e,t,o){},"7f69":function(e,t,o){},b734:function(e,t,o){},be22:function(e,t,o){"use strict";var r=o("6451"),n=o.n(r);n.a},f008:function(e,t,o){"use strict";var r=o("12a9"),n=o.n(r);n.a},fb56:function(e,t,o){"use strict";var r=o("7f69"),n=o.n(r);n.a}}); 2 | //# sourceMappingURL=app.f8838470.js.map -------------------------------------------------------------------------------- /app/templates/index.html: -------------------------------------------------------------------------------- 1 | awesome-qrcode
-------------------------------------------------------------------------------- /awesome_qrcode.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == '__main__': 4 | app.run() 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | gunicorn 3 | pillow 4 | numpy 5 | imageio --------------------------------------------------------------------------------